Install - vFunction and OpenTelemetry Agents on Linux .NET Core Agent running on a 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:
- Download and install the two .NET Agents you want to run simultaneously
- Download the Datadog Multiplexer
- Configure the Datadog Multiplexer for the two .NET Agents you want to run simultaneously
- Add the vendor-specific environment variables for the two .NET Agents you want to run
- Add the generic .NET Agent environment variables to run the Datadog Multiplexer
- Restart the Application
.NET Core Compatibility
vFunction supports C# .NET Core version 3.x and .NET 6.x, 7.x and 8.x applications.
Installation Wizard
To help with the installation process, vFunction offers an Installation Wizard. This Wizard provides additional information about the Prerequisites as well as steps for deploying the vFunction Agent to your environment.
Please contact support@vfunction.com or your vFunction Contact(s) for the password to start using this Wizard.
Installation Steps
- Ensure Prerequisites are met
- Download the vFunction Sudoless Controller Installation TGZ
- SSH to the Linux VM as the user who runs the Application
- Move the Installation TGZ to the location on the Linux VM where the vFunction Agent should run
- Extract the vFunction Installation Package
### Replace VERSION with the actual value
tar -xvzf vfunction-controller-sudo-less-installation.vVERSION.tgz
- Add Environment Variables for the vFunction Dynamic Agent
# See description in https://kb.vfunction.com/installations/configurable-settings/mono-dynamic-agent/dotnet/linux
export VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_NAME="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_HOST="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_ORG_ID="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_APP_ID="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_ID="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_SECRET="CHANGE_ME"
export VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_INSTANCE_ID="CHANGE_ME"
- Run the vFunction Monolithic Agent installation script
### Replace the BASE_DIR with the actual value, such as /tmp/
bash BASE_DIR/vfunction/opt/vfunction/controller-installation/install.sh -i default-dotnet
- Download a script to run the Application with the vFunction and OpenTelemetry Agents hooked. Alternatively, copy-and-paste the script below
#!/usr/bin/env sh
set -x
### Set URL for vFunction Server Login, such as "http://10.0.0.1" or "https://vfunction.org.com"
VF_SERVER_ADDRESS=""
### Set UUID taken from VF Server UI's "Installation Instructions" link in the Learning Tab, such as "47a10489-0000-0000-bc6e-579477ed6f40"
VF_APP_ID=""
### Set Path to where the various components were installed, such as "/home/charlotteLee"
REPLACE_BASE_DIR=""
### Set Service Name for this component of your Application, such as "Receipt Handler"
MyService=""
### Set workflow to start the application, such as "dotnet run"
RUN_APP=""
echo "Download the OpenTelemetry .NET Auto Install Script"
curl -sSfL https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest/download/otel-dotnet-auto-install.sh -O
echo "Install the OpenTelemetry Core Files"
sh ./otel-dotnet-auto-install.sh
echo "Enable execution for the OpenTelemetry Instrumentation Script"
chmod +x $HOME/.otel-dotnet-auto/instrument.sh
echo "Run OpenTelemetry Instrumentation Script"
. $HOME/.otel-dotnet-auto/instrument.sh
echo "Adding OpenTelemetry environment variables for vFunction"
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=$VF_SERVER_ADDRESS/api/unauth/otlp
export OTEL_TRACES_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=none
export OTEL_LOGS_EXPORTER=none
export OTEL_EXPORTER_OTLP_HEADERS=X-VF-APP=$VF_APP_ID
export OTEL_SERVICE_NAME=$MyService
echo "Adding vFunction environmental variables"
export VF_AGENT_CONF_LOCATION=$REPLACE_BASE_DIR/vfunction/etc/sysconfig/vfunction/agent/instances/default-dotnet/conf.json
export DOTNET_TailCallOpt=0
echo "Adding Datadog Multiplexer environment variables"
export CORECLR_PROFILER_PATH=$REPLACE_BASE_PATH/datadog/Datadog.Trace.ClrProfiler.Native.so
export CORECLR_ENABLE_PROFILING=1
export CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
echo "Starting Application"
$RUN_APP
- Download the Multiplexer Agent
- Download the Multiplexer’s Config File
- Rename the downloaded loader-otel-vf.conf to loader.conf
- Modify the loader.conf following the directions in the Comments
- Add the loader.conf and Multiplexer Agent to the Application’s file system in the same directory, e.g. /home/charlotteLee/
- Modify the run-app-multiplexer-otel-vf.sh following the directions in the Comments
- Start Learning in the VF Server UI for both the Monolithic and Distributed Applications
- Run the run-app-multiplexer-otel-vf.sh script
- Test the Application to confirm functionality and validate learning results
- If any issues arise: