Last updated: August 7, 2026
Getting Started
Installation
Install the distribution from PyPI:
1pip install dash0-opentelemetry
This single package pulls in the full upstream auto-instrumentation set, the pure-Python OTLP exporters, and all resource detectors.
No additional opentelemetry-bootstrap step is required.
Minimal quick start
Point the distribution at a collector and run your application under opentelemetry-instrument:
12export DASH0_OTEL_COLLECTOR_BASE_URL=http://localhost:4318opentelemetry-instrument python app.py
That is enough to auto-instrument all installed libraries and export traces, metrics, and logs over OTLP/HTTP. Your application needs zero OpenTelemetry imports.
Sending directly to Dash0
To export directly to the Dash0 ingress instead of a local collector, use the Dash0 ingress URL and add an authorization header:
123export DASH0_OTEL_COLLECTOR_BASE_URL=https://ingress.<region>.<cloud>.dash0.comexport OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer $DASH0_AUTH_TOKEN,Dash0-Dataset=default"opentelemetry-instrument python app.py
Running the Flask example
The repository ships a self-contained, Docker-based Flask demo in examples/dash0-distro-flask.
It demonstrates zero-code instrumentation, pure-Python OTLP/HTTP export, Kubernetes pod-UID detection, and telemetry.distro.name in resource attributes.
123cd examples/dash0-distro-flaskexport SCRIPT_UID=$(id -u) SCRIPT_GID=$(id -g)docker compose up
Exported telemetry is written to JSONL files in output/ (traces, metrics, logs).
To overlay Dash0 ingress instead of the local collector:
1234export DASH0_ENDPOINT=https://ingress.<region>.<cloud>.dash0.comexport DASH0_AUTH_TOKEN=auth_xxxxxxxxxxxxxxxxexport DASH0_DATASET=defaultdocker compose -f docker-compose.yml -f docker-compose.dash0.yml up
What happens at startup
When opentelemetry-instrument runs:
Dash0Distrois discovered via theopentelemetry_distroentry point. It checksDASH0_DISABLEandDASH0_OTEL_COLLECTOR_BASE_URL. If either gate fails, it setsOTEL_SDK_DISABLED=trueand skips all instrumentation.- The distro selects the pure-Python OTLP/HTTP exporter, sets
OTEL_EXPORTER_OTLP_ENDPOINT, and injects detected resource attributes into the environment. - Each installed instrumentor is loaded defensively: failures are logged and skipped.
Dash0Configuratoris discovered via theopentelemetry_configuratorentry point. It delegates to the standard SDK configurator, then optionally emits a bootstrap span and installs signal handlers.- Your application starts.