Install - vFunction Distributed and AppDynamics .NET Framework Agents running on a Windows x64 Host



Overview

Microsoft .NET Applications have a limitation that only one Agent can be hooked into the Application at a time. To work around this limitation, the Datadog Multiplexer can be used as the Base Agent. This Datadog Multiplexer includes a configuration file that allows you to define two additional .NET Agents to run simultaneously on the Application without conflict.

At a high level, you’ll need to:

  1. Download and install the two .NET Agents you want to run simultaneously
  2. Download the Datadog Multiplexer
  3. Configure the Datadog Multiplexer for the two .NET Agents you want to run simultaneously
  4. Add the vendor-specific environment variables for the two .NET Agents you want to run
  5. Add the generic .NET Agent environment variables to run the Datadog Multiplexer
  6. Restart the Application

Installation Steps


OpenTelemetry Agent Installation

Take the following steps to install the OpenTelemetry Agent and configure it to send traces to the vFunction Server:

  1. Gather the vFunction Server UI’s UUID for the OpenTelemetry Application
  1. Log into the vFunction Server UI
  2. In the top-left corner, click the dropdown
  3. Click Add Application from the dropdown menu
  4. Type a name for the Application in the Application Name text field
  5. Toggle the slider to Distributed
  6. Click the blue Create button
  7. In the dialog box that launches, toggle the tabs to .NET
  8. In the text box with OTEL Environment Variables, find the OTEL_EXPORT_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADER. These will be used at a later stage of the installation
  1. Download the OpenTelemetry .NET AutoInstrumentation ZIP
  2. Extract the downloaded opentelemetry-dotnet-instrumentation-windows.zip to a location on the Application’s filesystem, such as C:\otel.
  3. Create User Environment Variables for the User that runs the Application. Note that this can be done manually in Windows or via PowerShell. Both workflows are outlined below:

Setting User Environment Variables Manually in Windows
  1. On the machine where the Application runs, open the Windows Start Menu and search for, “environment variables”
  2. Select the search results to edit the environment variables
  3. On the System Properties dialog box, make sure the Advanced tab is selected
  4. Select the Environment Variables button at the bottom of this page
  5. In the Environment Variables dialog box, find the top section for User variables
  6. Click the New… button and create the following Variables and Values

Note that the Variable Names below are accurate but the Values are not. Use the values relevant to where the OpenTelemetry Instrumentation ZIP was extracted, such as C:\otel

Variable
Value
OTEL_DOTNET_AUTO_INSTALL_DIR C:\otel
DOTNET_ADDITIONAL_DEPS C:\otel\AdditionalDeps
DOTNET_SHARED_STORE C:\otel\store
DOTNET_STARTUP_HOOKS C:\otel\net\OpenTelemetry.AutoInstrumentation.StartupHook.dll
OTEL_DOTNET_AUTO_HOME C:\otel
OTEL_EXPORTER_OTLP_PROTOCOL http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT https://vfunction.mycompany.com/api/unauth/otlp as an example
OTEL_TRACES_EXPORTER otlp
OTEL_METRICS_EXPORTER none
OTEL_LOGS_EXPORTER none
OTEL_EXPORTER_OTLP_HEADERS X-VF-APP=93af7f38-0000-0000-0000-bd9516798497 as an example

Some additional flags can be added if the Services talks to a SQL Server or an Oracle Database. These are optional Environment Variables.

Variable
Value
Optional for Microsoft SQL Server: OTEL_DOTNET_AUTO_SQLCLIENT_SET_DBSTATEMENT_FOR_TEXT true
Optional for Oracle: OTEL_DOTNET_AUTO_ORACLEMDA_SET_DBSTATEMENT_FOR_TEXT true

Setting User Environment Variables via PowerShell
  1. On the machine where the Application runs, open PowerShell and run the following commands. Note the comments to modify the Values for some of the Keys
# The Keys below have Values that are going to be environmentally-specific 
# Such as C:\otel and vfunction.mycompany.com and the App's VF UUID
# Review and modify this list
[System.Environment]::SetEnvironmentVariable('OTEL_DOTNET_AUTO_INSTALL_DIR', 'C:\otel', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('DOTNET_ADDITIONAL_DEPS', 'C:\otel\AdditionalDeps', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('DOTNET_SHARED_STORE', 'C:\otel\store', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('DOTNET_STARTUP_HOOKS', 'C:\otel\net\OpenTelemetry.AutoInstrumentation.StartupHook.dll', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('OTEL_DOTNET_AUTO_HOME', 'C:\otel', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('OTEL_EXPORTER_OTLP_ENDPOINT', 'https://vfunction.mycompany.com/api/unauth/otlp as an example', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('OTEL_EXPORTER_OTLP_HEADERS', 'X-VF-APP=93af7f38-0000-0000-0000-bd9516798497 as an example', [System.EnvironmentVariableTarget]::User)

# The Keys below have Values that do not need to be modified
[System.Environment]::SetEnvironmentVariable('OTEL_EXPORTER_OTLP_PROTOCOL', 'http/protobuf', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('OTEL_TRACES_EXPORTER', 'otlp', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('OTEL_METRICS_EXPORTER', 'none', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('OTEL_LOGS_EXPORTER', 'none', [System.EnvironmentVariableTarget]::User)

Add the DataDog Tracer to Funnel Traces to AppDynamics and vFunction

Take the following steps to install the DataDog Multiplexer:

  1. RDP to the Windows Server where the Application runs
  2. Create a directory for the DataDog Multiplexer, such as C:\multiplexer
  3. Download the DataDog Multiplexer Agent to this directory
  4. Create the DataDog Multiplexer’s loader.conf Configuration File in the same directory. Note that the folder paths may need to be adjusted for your environment:
################# AFTER CHANGES #################
#Profiler

#Tracer
CUSTOM;{918728DD-259F-4A6A-AC2B-B85E1B658318};win-x64;C:\otel\win-x64\OpenTelemetry.AutoInstrumentation.Native.dll

#Custom
CUSTOM;{AEB86E5F-8AF7-4A74-B338-3BC6586E6E12};win-x64;C:\Program Files\AppDynamics\AppDynamics .NET Agent\AppDynamics.Profiler_x64.dll

Add Hooks to the Application for the DataDog Multiplexer

Use Option A: Manually Created User Environment Variables or Option B: PowerShell Created User Environment Variables to hook the DataDog Multiplexer into the running Application and to then feed trace information to both the vFunction Runtime Agent and Dynatrace OneAgent.


Option A: Manually Created User Environment Variables
  1. On the machine where the Application runs, open the Windows Start Menu and search for, “environment variables”
  2. Select the search results to edit the environment variables
  3. On the “System Properties” dialog box, make sure the “Advanced” tab is selected
  4. Select the “Environment Variables” button at the bottom of this page
  5. In the Environment Variables dialog box, find the top section for “User variables”
  6. Click the “New…” button and create the following Variables and Values
Key
Value
COR_ENABLE_PROFILING 1
COR_PROFILER {846F5F1C-F9AE-4B07-969E-05C26BC060D8}
COR_PROFILER_PATH C:\multiplexer\Datadog.Trace.ClrProfiler.Native.dll

Option B: PowerShell Created User Environment Variables
  1. On the Windows machine where the Application runs, open PowerShell
[System.Environment]::SetEnvironmentVariable('COR_ENABLE_PROFILING', '1', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('COR_PROFILER', '{846F5F1C-F9AE-4B07-969E-05C26BC060D8}', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('COR_PROFILER_PATH', 'C:\multiplexer\Datadog.Trace.ClrProfiler.Native.dll', [System.EnvironmentVariableTarget]::User)

Confirm Functionality

  1. Restart the .NET Application
  2. Confirm the Application functions as expected
  3. Confirm that AppDynamics is capturing informaton about the Application as expected
  4. Confirm that the OpenTelemetry Agent is capturing data as expected by starting Learning and validating learning results