About the Dash0 OpenTelemetry Node.js Distribution
The Dash0 distribution of OpenTelemetry for Node.js is a thin, opinionated layer on top of the upstream OpenTelemetry JS SDK that instruments Node.js applications with no code changes.
You load it with --require, and it sets up tracing, metrics and logging before your application code runs.
The distribution is published on npm as @dash0/opentelemetry .
It is primarily intended to be injected by the Dash0 operator for Kubernetes, but it works equally well when you add it to an application yourself.
What you get
Zero-code instrumentation. Load the distribution with node --require @dash0/opentelemetry or via NODE_OPTIONS.
Your application needs no @opentelemetry/* imports.
The upstream auto-instrumentation set, built in. The distribution ships @opentelemetry/auto-instrumentations-node .
See Auto-instrumentation for the details.
Traces, metrics and logs over OTLP. All three signals are exported with OTLP over HTTP with protobuf encoding to the collector named by DASH0_OTEL_COLLECTOR_BASE_URL.
Declarative configuration. Instead of environment variables, the SDK can be configured with an OpenTelemetry configuration file. See Declarative configuration.
Sensible, injection-friendly defaults. The distribution detects the Kubernetes pod UID, derives a service name from the application's package.json, marks telemetry with telemetry.distro.name, propagates W3C Trace Context, W3C Baggage and AWS X-Ray headers, and flushes telemetry when the event loop empties.
See Configuration and Resource detection.
Graceful self-deactivation. The distribution disables itself, instead of breaking the application, when the application is already instrumented with the OpenTelemetry SDK, when the Node.js version is not supported, or when no export destination is configured. See Kubernetes injection.
Two OpenTelemetry SDK lines
The OpenTelemetry JS SDK 2.x does not support older Node.js versions, so the distribution bundles both SDK lines and picks one at startup:
| Node.js version | OpenTelemetry JS SDK |
|---|---|
| 16.x to 18.18.x | 1.x |
| 18.19.0 to 18.x | 2.x |
| 20.0.0 to 20.5.x | 1.x |
| 20.6.0 and later | 2.x |
Some features, such as declarative configuration and the AWS X-Ray propagator, are only available with the 2.x line. The distribution logs a warning on Node.js versions newer than those it has been tested with, but still starts.
Relationship to the upstream OpenTelemetry SDK
The distribution is a thin layer on top of the upstream @opentelemetry/sdk-node package.
It sets the exporters, resource detectors, propagators and instrumentations, and adds a few Dash0-specific options.
Standard OTEL_* environment variables that the upstream NodeSDK reads, for example OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES and OTEL_EXPORTER_OTLP_HEADERS, work as documented by the upstream project.
Last updated: