SigNoz Cloud - This page is relevant for SigNoz Cloud editions.
Self-Host - This page is relevant for self-hosted SigNoz editions.

.NET OpenTelemetry Instrumentation

This guide shows you how to instrument your .NET application with OpenTelemetry and send traces to SigNoz using zero-code automatic instrumentation. This approach requires no code changes to your application.

Prerequisites

Send traces to SigNoz

Step 1. Install the instrumentation

Download and run the OpenTelemetry .NET automatic instrumentation installer:

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

sh ./otel-dotnet-auto-install.sh

chmod +x $HOME/.otel-dotnet-auto/instrument.sh
Info

On macOS, install coreutils first: brew install coreutils

Step 2. Run your application with zero-code instrumentation

. $HOME/.otel-dotnet-auto/instrument.sh

OTEL_SERVICE_NAME=<service-name> \
OTEL_TRACES_EXPORTER=otlp \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.<region>.signoz.cloud:443 \
OTEL_EXPORTER_OTLP_HEADERS=signoz-ingestion-key=<your-ingestion-key> \
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=production,service.version=1.0.0 \
dotnet run

Replace:

  • <service-name>: Your service name (e.g., payment-service)
  • <region>: Your SigNoz Cloud region (us, eu, or in). See endpoints.
  • <your-ingestion-key>: Your SigNoz ingestion key.

Validate

  1. Generate traffic by making requests to your application.
  2. Open SigNoz and go to Services.
  3. Look for your service name in the list.
  4. Click on your service to view traces, latency, and error rates.

Troubleshooting

How do I verify traces are being generated?

Enable the console exporter to see traces in your terminal:

# Linux/macOS
OTEL_DOTNET_AUTO_TRACES_CONSOLE_EXPORTER_ENABLED=true dotnet run

# Windows PowerShell
$env:OTEL_DOTNET_AUTO_TRACES_CONSOLE_EXPORTER_ENABLED = "true"
dotnet run

You should see output like:

Activity.TraceId:            e1c2b70e9f39c6cc15d5d94b75412b70
Activity.SpanId:             17da84c0833e0075
Activity.DisplayName:        /
Activity.Kind:               Server

Traces not appearing in SigNoz?

  • Verify endpoint format: https://ingest.<region>.signoz.cloud:443
  • Check ingestion key format: signoz-ingestion-key=<key> with no extra spaces
  • Ensure outbound HTTPS on port 443 is allowed

Connection refused errors?

  • Cloud: Check internet connection and region
  • Self-hosted: Verify collector is running on port 4317 (gRPC) or 4318 (HTTP)
  • Kubernetes: Ensure collector service name matches instrumentation endpoint

Setup OpenTelemetry Collector (Optional)

What is the OpenTelemetry Collector?

Think of the OTel Collector as a middleman between your app and SigNoz. Instead of your application sending data directly to SigNoz, it sends everything to the Collector first, which then forwards it along.

Why use it?

  • Cleaning up data: Filter out noisy traces you don't care about, or remove sensitive info before it leaves your servers.
  • Keeping your app lightweight: Let the Collector handle batching, retries, and compression instead of your application code.
  • Adding context automatically: The Collector can tag your data with useful info like which Kubernetes pod or cloud region it came from.
  • Future flexibility: Want to send data to multiple backends later? The Collector makes that easy without changing your app.

See Switch from direct export to Collector for step-by-step instructions to convert your setup.

For more details, see Why use the OpenTelemetry Collector? and the Collector configuration guide.

Next steps

Sample application:

Last updated: January 17, 2026

Edit on GitHub

Was this page helpful?