Install - vFunction Monolithic and Datadog .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 Profiler can be used as the Base Agent. This Datadog Profiler includes a configuration file that allows you to define additional .NET Agents to run simultaneously on the Application without conflict.

At a high level, you’ll need to:

  1. Download and install the vFunction Monolithic .NET Agent
  2. Modify the Datadog .NET Profiler to add the vFunction Monolithic .NET Agent as a Custom Profiler
  3. Restart the Application

.NET Framework Compatibility

vFunction supports C# .NET Framework version 4.8.x applications.


Installation Steps


vFunction Monolithic Agent Installation

The steps below ensure that the vFunction Monolithic Agent’s configuration files are set for your environment. These steps alone do not hook the vFunction Monolithic Agent into the Application. You’ll also need to modify the DataDog Configuration to add the vFunction Monolithic Agent to hook the Application with the vFunction Monolithic Agent.

  1. Ensure vFunction Monolithic Agent Prerequisites are met
  2. Download the vFunction Windows Controller Installation ZIP for the vFunction Monolithic Agent
  3. RDP to the Windows Server as the user who runs the Application
  4. Move the vFunction Windows Controller Installation ZIP to the location on the Windows Server where the vFunction Agent should run
  5. Unzip the vFunction Installation Package to, for example, C:\vfunction
  6. Add the configuration settings for the vFunction Monolithic Agent either as Option A: Manually Created User Environment Variables, as Option B: an installation.yaml or Option C: PowerShell Created User Environment Variables

Option A: Manually Created User Environment Variables

Take the following steps to add configuration settings via User Environment Variables:

  1. Log into the vFunction Server’s UI in a browser
  2. In the top-left corner, click the dropdown and select the relevant Application
  3. In the top-center menu bar, click the “Learning” tab
  4. On the left-side, click the “Select Controllers” link
  5. On the left-side, click the “Install Controller” link
  6. In the dialog box, find the YAML-formatted text box that contains the following details. You’ll need these details at a later stage below:
controller:
  name: {display name for this controller}
  host: $your_VF_Server_address
  org_id: 93af7f38-0000-0000-0000-bd9516798497
  app_id: 9fb228fc-0000-0000-0000-db8e83427e14
  client_id: caeadcd1-0000-0000-0000-9c9b37a9e119
  client_secret: 68cb85eb-0000-0000-0000-fb9e7f1d9240
  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 for your environment retrieved from Step #6 above

Variable
Value
VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_NAME Create your own display name for this controller such as QA-Windows-1
VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_HOST $your_VF_Server_address such as https://demo.vfunction.com
VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_ORG_ID 93af7f38-0000-0000-0000-bd9516798497 as an example
VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_APP_ID 9fb228fc-0000-0000-0000-db8e83427e14 as an example
VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_ID caeadcd1-0000-0000-0000-9c9b37a9e119 as an example
VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_SECRET 68cb85eb-0000-0000-0000-fb9e7f1d9240 as an example
VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_INSTANCE_ID Create your own display name for this controller such as QA-Windows-1

Option B: An Installation.yaml

Take the following steps to add configuration settings via an installation.yaml:

  1. Log into the vFunction Server’s UI in a browser
  2. In the top-left corner, click the dropdown and select the relevant Application
  3. In the top-center menu bar, click the “Learning” tab
  4. On the left-side, click the “Select Controllers” link
  5. On the left-side, click the “Install Controller” link
  6. In the dialog box, find the YAML-formatted text box that contains the following details. You’ll need these details at a later stage below:
controller:
  name: {display name for this controller}
  host: $your_VF_Server_address
  org_id: 93af7f38-0000-0000-0000-bd9516798497
  app_id: 9fb228fc-0000-0000-0000-db8e83427e14
  client_id: caeadcd1-0000-0000-0000-9c9b37a9e119
  client_secret: 68cb85eb-0000-0000-0000-fb9e7f1d9240
  1. On the machine where the Application runs, open the installation.yaml at the location relevant to where you unpacked the vFunction Controller Installation ZIP, such as C:\vfunction\config\installation\instances\default-dotnet\installation.yaml
### BEFORE
controller:
  name:
  host:
  org_id:
  app_id:
  client_id:
  client_secret:
  type: dotnet
  instrconf_additions:
    inclusions:
#      - a.b.c.
    exclusions:
#      - a.b.c.
  tags:
#    - tag1


### AFTER COPYING FROM STEP #6 ABOVE
controller:
  name: Create your own display name for this controller such as QA-Windows-1
  host: $your_VF_Server_address such as https://demo.vfunction.com
  org_id: 93af7f38-0000-0000-0000-bd9516798497 as an example
  app_id: 9fb228fc-0000-0000-0000-db8e83427e14 as an example
  client_id: caeadcd1-0000-0000-0000-9c9b37a9e119 as an example
  client_secret: 68cb85eb-0000-0000-0000-fb9e7f1d9240 as an example
  type: dotnet
  instrconf_additions:
    inclusions:
#      - a.b.c.
    exclusions:
#      - a.b.c.
  tags:
#    - tag1

Option C: PowerShell Created User Environment Variables

Take the following steps to add configuration settings via PowerShell:

  1. Log into the vFunction Server’s UI in a browser
  2. In the top-left corner, click the dropdown and select the relevant Application
  3. In the top-center menu bar, click the “Learning” tab
  4. On the left-side, click the “Select Controllers” link
  5. On the left-side, click the “Install Controller” link
  6. In the dialog box, find the YAML-formatted text box that contains the following details. You’ll need these details at a later stage below:
controller:
  name: {display name for this controller}
  host: $your_VF_Server_address
  org_id: 93af7f38-0000-0000-0000-bd9516798497
  app_id: 9fb228fc-0000-0000-0000-db8e83427e14
  client_id: caeadcd1-0000-0000-0000-9c9b37a9e119
  client_secret: 68cb85eb-0000-0000-0000-fb9e7f1d9240
  1. On the machine where the Application runs, open PowerShell
# The Keys below have Values that are going to be environmentally-specific
# Review and modify this list
[System.Environment]::SetEnvironmentVariable('VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_NAME', 'Create your own display name for this controller such as QA-Windows-1', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_HOST', 'your_VF_Server_address such as https://vfunction.mycompany.com', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_ORG_ID', '93af7f38-0000-0000-0000-bd9516798497 as an example', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_APP_ID', '9fb228fc-0000-0000-0000-db8e83427e14 as an example', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_ID', 'caeadcd1-0000-0000-0000-9c9b37a9e119 as an example', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_SECRET', '68cb85eb-0000-0000-0000-fb9e7f1d9240 as an example', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_INSTANCE_ID', 'Create your own display name for this controller such as QA-Windows-1', [System.EnvironmentVariableTarget]::User)

  1. After following Option A, Option B or Option C to add the configuration settings for the vFunction Dynamic Agent, launch PowerShell as an Administrator and run the vFunction Monolithic Agent installation script
### Replace $BASE_DIR with the Windows location where the vFunction Installation ZIP was unzipped
dir -Path "$BASE_DIR" -Recurse | Unblock-File

powershell -NoProfile -ExecutionPolicy unrestricted -Command "$BASE_DIR\controller-installation\install.ps1 -instance default-dotnet"
  1. Add User Environment Variables for the vFunction Monolithic Agent either manually using the UI or via PowerShell

Manually using the UI
  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 $BASE_DIR needs to be replaced with the actual installation location
Variable
Value
VF_AGENT_CONF_LOCATION $BASE_DIR\config\agent\instances\default-dotnet\conf.json
COMPlus_TailCallOpt 0

Using PowerShell
  1. On the Windows machine where the Application runs, open PowerShell
# Modify the $BASE_DIR based on the location of the VF Agent installation, such as C:\vfunction
[System.Environment]::SetEnvironmentVariable('VF_AGENT_CONF_LOCATION', '$BASE_DIR\config\agent\instances\default-dotnet\conf.json', [System.EnvironmentVariableTarget]::User)

[System.Environment]::SetEnvironmentVariable('DOTNET_TailCallOpt', '0', [System.EnvironmentVariableTarget]::User)
  1. The vFunction Monolithic Agent is installed (all configuration files are set) but is not hooked into the Application. Use the steps below to modify the DataDog configuration to add the vFunction Monolithic Agent to the Application.

Modify the DataDog configuration to add the vFunction Monolithic Agent

The steps below assume that:

Take the following steps to modify the DataDog configuration to add the vFunction Monolithic Agent:

  1. Open the DataDog Profiler’s Configuration File. This is most likely located at C:\Program Files\Datadog.NET Tracer\win-x64\loader.conf
  2. Add the vFunction Monolithic Agent to the loader.conf. Note that the example below uses the BASE_DIR of C:\vfunction. This section of the path would need to be adjusted if the BASE_DIR is in another location:
################# BEFORE #################
#Profiler
PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};win-x64;.\Datadog.Profiler.Native.dll
PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};win-x86;.\Datadog.Profiler.Native.dll
PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};linux-x64;./Datadog.Profiler.Native.so
PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};linux-musl-x64;./Datadog.Profiler.Native.so
# PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};linux-arm64;./Datadog.Profiler.Native.so
# PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};linux-musl-arm64;./Datadog.Profiler.Native.so

#Tracer
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};win-arm64;.\Datadog.Tracer.Native.dll
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};win-x64;.\Datadog.Tracer.Native.dll
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};win-x86;.\Datadog.Tracer.Native.dll
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};linux-x64;./Datadog.Tracer.Native.so
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};linux-musl-x64;./Datadog.Tracer.Native.so
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};linux-arm64;./Datadog.Tracer.Native.so
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};linux-musl-arm64;./Datadog.Tracer.Native.so
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};osx-x64;./Datadog.Tracer.Native.dylib
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};osx-arm64;./Datadog.Tracer.Native.dylib




################# AFTER #################
#Profiler
PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};win-x64;.\Datadog.Profiler.Native.dll
PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};win-x86;.\Datadog.Profiler.Native.dll
PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};linux-x64;./Datadog.Profiler.Native.so
PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};linux-musl-x64;./Datadog.Profiler.Native.so
# PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};linux-arm64;./Datadog.Profiler.Native.so
# PROFILER;{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A};linux-musl-arm64;./Datadog.Profiler.Native.so

#Tracer
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};win-arm64;.\Datadog.Tracer.Native.dll
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};win-x64;.\Datadog.Tracer.Native.dll
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};win-x86;.\Datadog.Tracer.Native.dll
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};linux-x64;./Datadog.Tracer.Native.so
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};linux-musl-x64;./Datadog.Tracer.Native.so
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};linux-arm64;./Datadog.Tracer.Native.so
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};linux-musl-arm64;./Datadog.Tracer.Native.so
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};osx-x64;./Datadog.Tracer.Native.dylib
TRACER;{50DA5EED-F1ED-B00B-1055-5AFE55A1ADE5};osx-arm64;./Datadog.Tracer.Native.dylib

#Custom
CUSTOM;{cd7d4b53-96c8-4552-9c11-6e41df8eab8a};win-x64;C:\vfunction\agent\vfagent.net.dll
  1. Restart the .NET Application
  2. Confirm the Application functions as expected
  3. Confirm that Datadog is captured informaton about the Application as expected
  4. Confirm that the vFunction Monolithic Agent is capturing data as expected by starting Learning and validating learning results