Last updated:
Getting Started
Installation
Install the distribution from PyPI:
pip install dash0-opentelemetryThis 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:
export DASH0_OTEL_COLLECTOR_BASE_URL=http://localhost:4318
opentelemetry-instrument python app.pyThat 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:
export DASH0_OTEL_COLLECTOR_BASE_URL=https://ingress.<region>.<cloud>.dash0.com
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer $DASH0_AUTH_TOKEN,Dash0-Dataset=default"
opentelemetry-instrument python app.pyRunning 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.
cd examples/dash0-distro-flask
export SCRIPT_UID=$(id -u) SCRIPT_GID=$(id -g)
docker compose upExported telemetry is written to JSONL files in output/ (traces, metrics, logs).
To overlay Dash0 ingress instead of the local collector:
export DASH0_ENDPOINT=https://ingress.<region>.<cloud>.dash0.com
export DASH0_AUTH_TOKEN=auth_xxxxxxxxxxxxxxxx
export DASH0_DATASET=default
docker compose -f docker-compose.yml -f docker-compose.dash0.yml upWhat 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.