OpenTelemetry Agent - .NET Windows IIS Site Installation
Installation Steps
- Configure the .NET Startup Parameters
- In a text editor, open the
C:\Windows\System32\inetsrv\config\applicationHost.config
XML - Search for the term
applicationPools
in the applicationHost.config - Modify the XML entry for the Application Pool used by the Application
- 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
- Under the applicationPools node, find the relevant application pool and add the env vars:
<add name="DefaultAppPool" autoStart="true">
<environmentVariables>
<add name="OTEL_EXPORTER_OTLP_PROTOCOL" value="http/protobuf" />
<add name="OTEL_EXPORTER_OTLP_ENDPOINT" value="$PROTOCOL://$VF_SERVER_ADDRESS/api/unauth/otlp" />
<add name="OTEL_TRACES_EXPORTER" value="otlp" />
<add name="OTEL_METRICS_EXPORTER" value="none" />
<add name="OTEL_LOGS_EXPORTER" value="none" />
<add name="OTEL_EXPORTER_OTLP_HEADERS" value="X-VF-APP=$VF_APP_ID"/>
</environmentVariables>
</add>
- Save and close the file
- Configure OpenTelemetry .NET Instrumentation for your App from PowerShell 5.1 or higher and restart Windows IIS
NOTE: These steps are taken from OpenTelemetry .NET Windows PowerShell Instrumentation.
# Download the module
$module_url = "https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest/download/OpenTelemetry.DotNet.Auto.psm1"
$download_path = Join-Path $env:temp "OpenTelemetry.DotNet.Auto.psm1"
Invoke-WebRequest -Uri $module_url -OutFile $download_path -UseBasicParsing
# Import the module
Import-Module $download_path
# Install core files
Install-OpenTelemetryCore
# Setup IIS instrumentation
Register-OpenTelemetryForIIS