Getting Started
Note: This page is auto-generated from the opentelemetry-dotnet-distribution repository.
The primary use case for this distribution is injection into .NET workloads by the Dash0 Kubernetes operator, which does everything on this page for you. If that is your use case, skip to Kubernetes injection. Read on to install the distribution by hand, for example for local development, a container image you build yourself, or a deployment outside Kubernetes.
Choose an archive
Each release attaches four archives. Pick the one that matches the C library and the CPU architecture of the system that runs the application:
| Archive | C library | Architecture |
|---|---|---|
dash0-opentelemetry-dotnet-instrumentation-linux-x64.tar.gz | glibc 2.23 or later | x86_64 |
dash0-opentelemetry-dotnet-instrumentation-linux-arm64.tar.gz | glibc 2.23 or later | aarch64 |
dash0-opentelemetry-dotnet-instrumentation-linux-musl-x64.tar.gz | musl 1.2 or later | x86_64 |
dash0-opentelemetry-dotnet-instrumentation-linux-musl-arm64.tar.gz | musl 1.2 or later | aarch64 |
Use a musl archive for Alpine-based .NET images, and a glibc archive for everything else.
Install the distribution
Download and extract the archive.
Replace <tag> with a release tag (for example v0.1.0) and <archive> with the archive name from the table above:
mkdir -p /opt/dash0/otel-dotnet-auto
curl -fsSL \
https://github.com/dash0hq/opentelemetry-dotnet-distribution/releases/download/<tag>/<archive> \
| tar -xz -C /opt/dash0/otel-dotnet-autoThe archive extracts to the upstream tracer-home layout:
net/ # managed assemblies and the startup hook
linux-<arch>/ or linux-musl-<arch>/ # OpenTelemetry.AutoInstrumentation.Native.so (the CoreCLR profiler)
instrument.sh # sets the environment variables that enable instrumentation
LICENSE, NOTICEStart the application
Point OTEL_DOTNET_AUTO_HOME at the extracted directory, source instrument.sh, and start the application as usual:
export OTEL_DOTNET_AUTO_HOME=/opt/dash0/otel-dotnet-auto
. "${OTEL_DOTNET_AUTO_HOME}/instrument.sh"
export OTEL_SERVICE_NAME=my-service
export OTEL_EXPORTER_OTLP_ENDPOINT=http://your-collector:4318
dotnet YourApp.dllinstrument.sh sets CORECLR_ENABLE_PROFILING, CORECLR_PROFILER, CORECLR_PROFILER_PATH, and DOTNET_STARTUP_HOOKS.
It must be sourced (with .), not executed, so that the variables reach the application process.
On startup the distribution exports traces, metrics, and logs to the OTLP endpoint.
Export directly to Dash0
To export directly to Dash0 without a collector, use your organization's Dash0 OTLP endpoint and an authorization token:
export OTEL_DOTNET_AUTO_HOME=/opt/dash0/otel-dotnet-auto
. "${OTEL_DOTNET_AUTO_HOME}/instrument.sh"
export OTEL_SERVICE_NAME=my-service
export OTEL_EXPORTER_OTLP_ENDPOINT=<your-dash0-otlp-endpoint>
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <your-token>"
dotnet YourApp.dllUse it in a container image
In a Dockerfile, extract the archive and set the variables that instrument.sh would set, because ENV cannot source a script:
FROM alpine:3.22 AS otel-dotnet
ARG DASH0_DOTNET_VERSION=<tag>
RUN apk add --no-cache curl \
&& mkdir -p /opt/dash0/otel-dotnet-auto \
&& curl -fsSL \
"https://github.com/dash0hq/opentelemetry-dotnet-distribution/releases/download/${DASH0_DOTNET_VERSION}/dash0-opentelemetry-dotnet-instrumentation-linux-x64.tar.gz" \
| tar -xz -C /opt/dash0/otel-dotnet-auto
FROM mcr.microsoft.com/dotnet/aspnet:8.0
COPY --from=otel-dotnet /opt/dash0/otel-dotnet-auto /opt/dash0/otel-dotnet-auto
ENV OTEL_DOTNET_AUTO_HOME=/opt/dash0/otel-dotnet-auto \
CORECLR_ENABLE_PROFILING=1 \
CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} \
CORECLR_PROFILER_PATH=/opt/dash0/otel-dotnet-auto/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so \
DOTNET_STARTUP_HOOKS=/opt/dash0/otel-dotnet-auto/net/OpenTelemetry.AutoInstrumentation.StartupHook.dllThe example downloads the archive in a separate build stage, because the .NET runtime images do not include curl.
Replace linux-x64 in the archive name and in CORECLR_PROFILER_PATH with the variant that matches your image, for example linux-musl-x64 for an Alpine-based image.
Next steps
Last updated: