AutoMerge is generally available

Last updated:

Configuration

All Dash0-specific and standard OpenTelemetry environment variables for the Python distribution.

Dash0-specific environment variables

VariableEffect
DASH0_OTEL_COLLECTOR_BASE_URLRequired. OTLP endpoint to export to. If unset, the distribution disables itself entirely and sets OTEL_SDK_DISABLED=true.
DASH0_DISABLESet to true to disable the distribution entirely. The SDK becomes a no-op.
DASH0_AUTOMATIC_SERVICE_NAMESet to false to opt out of detected service.name and service.version.
DASH0_BOOTSTRAP_SPANName of a single span to emit once at startup. Useful for confirming the distribution is active.
DASH0_FLUSH_ON_SIGTERM_SIGINTSet to true to flush all telemetry (traces, metrics, logs) on SIGTERM or SIGINT before exiting. Signal handlers can only be installed from the main thread; if the distribution is configured from a non-main thread, this setting is silently ignored.

Standard OpenTelemetry variables

All standard OTEL_* variables are honored. The distribution sets defaults using setdefault and never overrides values you provide.

The following variables are relevant to the distribution's behavior:

VariableDefault set by distroNotes
OTEL_TRACES_EXPORTERotlp_proto_httpPure-Python OTLP/HTTP exporter.
OTEL_METRICS_EXPORTERotlp_proto_httpPure-Python OTLP/HTTP exporter.
OTEL_LOGS_EXPORTERotlp_proto_httpPure-Python OTLP/HTTP exporter.
OTEL_EXPORTER_OTLP_PROTOCOLhttp/protobufSet to grpc for OTLP/gRPC.
OTEL_EXPORTER_OTLP_ENDPOINTValue of DASH0_OTEL_COLLECTOR_BASE_URLDerived automatically; override if needed.
OTEL_EXPORTER_OTLP_HEADERS—Headers sent with every OTLP request. Required for Dash0 authentication: Authorization=Bearer <token>,Dash0-Dataset=default.
OTEL_EXPORTER_OTLP_<SIGNAL>_PROTOCOL—Per-signal protocol override (TRACES, METRICS, LOGS).
OTEL_EXPORTER_OTLP_<SIGNAL>_ENDPOINT—Per-signal endpoint override. Custom ports and explicitly set endpoints are never rewritten by the distro.
OTEL_SERVICE_NAME—Standard service name. The distro adds a fallback derived from the entrypoint when this is unset.
OTEL_RESOURCE_ATTRIBUTES—Additional resource attributes. The distro reads this to detect whether service.name is already set, and appends its own detected attributes (telemetry.distro.*, k8s.pod.uid) to it.
OTEL_PYTHON_DISABLED_INSTRUMENTATIONS—Comma-separated list of instrumentor entry-point names to skip (e.g. flask,redis). Honored by the auto-instrumentation loader.
OTEL_EXPERIMENTAL_RESOURCE_DETECTORS—Comma-separated resource detector names, honored by the SDK's environment-based configuration. Declarative configuration (OTEL_CONFIG_FILE) never reads it.
OTEL_CONFIG_FILE—Path to a declarative SDK configuration file, which takes over from every variable above that configures providers, exporters or the resource. List the dash0_* detectors in the file to keep telemetry.distro.*, k8s.pod.uid and the service.name fallback.

Disabling the distribution

If you need to disable the distribution entirely without removing it:

bash
export DASH0_DISABLE=true
opentelemetry-instrument python app.py

The SDK becomes a no-op and no instrumentation or export occurs.

Setting a service name

The distribution uses the following priority order for service.name:

  1. OTEL_SERVICE_NAME (you set it explicitly)
  2. service.name from OTEL_RESOURCE_ATTRIBUTES
  3. Name from the installed distribution the process was started from
  4. [project].name from the nearest pyproject.toml, walking up from the entrypoint script
  5. Name derived from the entrypoint script basename (e.g., app.py → app)

Steps 3 and 4 also set service.version. Steps 2 through 5 are suppressed when DASH0_AUTOMATIC_SERVICE_NAME=false. See docs/resource-detection.md for how a distribution is identified and where the pyproject.toml walk stops.

To disable detection and keep service.name unset when you have not provided one:

bash
export DASH0_AUTOMATIC_SERVICE_NAME=false