Send .NET application data to Observe

Compatibility

.NET 4.6.2+ on the following platforms:

  • x86

  • AMD64 (x86-64)

  • ARM64 (Experimental, CentOS images not supported)

Get the Observe Agent

Install the Observe agent in your environment.

Install the OpenTelemetry zero-code instrumentation for .NET

The instrumentation is distributed via an installer script.

# Download the bash script
curl -sSfL https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest/download/otel-dotnet-auto-install.sh -O

# Install core files
sh ./otel-dotnet-auto-install.sh

# Enable execution for the instrumentation script
chmod +x $HOME/.otel-dotnet-auto/instrument.sh

# Setup the instrumentation for the current shell session
. $HOME/.otel-dotnet-auto/instrument.sh

coreutils is required. You can install it with:

brew install coreutils

From here the instructions are the same as for Linux.

Run the following as an administrator in Powershell 5.1+:

# 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 to use its functions
Import-Module $download_path

# Install core files (online vs offline method)
Install-OpenTelemetryCore

Instrument an ASP.NET application deployed on IIS

Run the following in Powershell (note, the final command will cause IIS to restart):

Import-Module "OpenTelemetry.DotNet.Auto.psm1"

Install-OpenTelemetryCore

Register-OpenTelemetryForIIS

Configure the instrumentation

Set the following environment variables:

Environment variable

Value

OTEL_SERVICE_NAME

your service name

Run your instrumented app

./MyNetApp
.\MyNetApp.exe

Next steps

Troubleshooting

If your data is not showing up in Observe, first verify that Observe Agent is receiving data from your application. See Troubleshooting the Observe Agent.

Common reasons why the Observe agent is not receiving traces from your application:

Default exporter settings override

By default, OpenTelemetry instrumentation exports data using standard OTLP settings, which are automatically compatible with the Observe Agent’s default receiver configuration.

This means that data from your application might not be reaching the Observe Agent if you have overridden the following environment variables with non-default settings:

  • OTEL_EXPORTER_OTLP_ENDPOINT

  • OTEL_EXPORTER_OTLP_TRACES_ENDPOINT

  • OTEL_EXPORTER_OTLP_METRICS_ENDPOINT

  • OTEL_EXPORTER_OTLP_LOGS_ENDPOINT

Ensure these variables are unset or set to the correct endpoint (e.g., http://localhost:4317 for gRPC or http://localhost:4318 for HTTP).

Ports blocked by firewall

Ensure that any firewalls within the same network as your app and collector are configured to allow traffic on ports 4317 and 4318. The application instrumentation uses these ports to communicate with the Observe agent.