OpenTelemetry Agent - .NET Windows Service Apps Installation
Installation Steps
- Configure the .NET Startup Parameters
- Open the Windows Server’s Registry Editor
- Open the Start Menu
- Search for regedit
- Launch the Registry Editor
- In the left-hand sidebar, expand the folders to get to the SERVICE_NAME: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SERVICE_NAME
- Right-click in the white space below the list of Registry Keys for the Service
- Select New > >Multi-String Value
- Replace New Value #1 with
Environment
- 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
- Click the OK button
- 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"