OpenTelemetry Agent - .NET Windows Service Apps Installation



Installation Steps

  1. Configure the .NET Startup Parameters
  1. Open the Windows Server’s Registry Editor
  1. Open the Start Menu
  2. Search for regedit
  3. Launch the Registry Editor
  1. In the left-hand sidebar, expand the folders to get to the SERVICE_NAME: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SERVICE_NAME
  2. Right-click in the white space below the list of Registry Keys for the Service
  3. Select New > >Multi-String Value
  4. Replace New Value #1 with Environment
  5. Double-click the new Environment variable to add Value Data entries
  • Find-and-replace $PROTOCOL with http or https based on the VF Server configuration
  • Find-and-replace $VF_SERVER_ADDRESS with the URL for login to your organization’s vFunction Server
  • Find-and-replace $VF_APP_ID with the Application UUID created with the Installation Instructions provided after creating the Distributed Application in the vFunction Server UI
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT=$PROTOCOL://$VF_SERVER_ADDRESS/api/unauth/otlp
OTEL_TRACES_EXPORTER=otlp
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORTER=none
OTEL_EXPORTER_OTLP_HEADERS=X-VF-APP=$VF_APP_ID
  1. Click the OK button
  1. Configure OpenTelemetry .NET Instrumentation for your App from PowerShell 5.1 or higher and restart the Windows Service

NOTE: These steps are taken from OpenTelemetry .NET Windows PowerShell Instrumentation.

# Import the module
Import-Module "OpenTelemetry.DotNet.Auto.psm1"

# Install core files
Install-OpenTelemetryCore

# Set up your Windows Service instrumentation
Register-OpenTelemetryForWindowsService -WindowsServiceName "WindowsServiceName" -OTelServiceName "MyServiceDisplayName"