Before you start. You need a license key and
your base endpoint from Get Started in the dashboard.
The four variables
Every OpenTelemetry SDK reads the same environment variables, and for most services setting them is the whole integration:OTEL_SERVICE_NAMEis what you will search by. Without it, records still arrive but appear under no service, which is the first place anyone looks.http/protobufis the default in newer SDKs and not in older ones. Set it explicitly rather than relying on the version you happen to have.
Zero-code languages
- Node.js
- Python
- Java
- .NET
--require and
not an import at the top of your entry file. An import runs after the
modules it needs to patch have already been resolved, and produces an app
that starts cleanly and emits nothing.Go
Go has no runtime agent — the compiler resolves calls at build time, so there is nothing to attach to a running process. The exporter is constructed explicitly:main and defer the returned shutdown. Skipping the shutdown loses
whatever is still in the batcher when the process exits, which is reliably the
spans from the request you were testing with.
Any other language
If there is no SDK you want to use, the ingest surface is plain OTLP/HTTP with a JSON body. Send data with OpenTelemetry has a complete request you can adapt, and Endpoints and errors documents every path and status code.Sending logs as well as traces
Auto-instrumentation covers traces and metrics everywhere; log export is per-language and less uniform. Two approaches, both fine:- Enable the SDK’s log exporter where your language supports it. Records arrive already correlated with the trace that produced them.
- Write structured logs to stdout and collect them with an OpenTelemetry Collector — the usual choice in Kubernetes, where the collector is already running to gather node telemetry. See Send data from Kubernetes.
trace_id in the log record if the SDK does not
add it for you. It is what turns a log line into a starting point for an
investigation instead of a sentence.
Verify
Turn on the SDK’s own diagnostics and restart the service:OTEL_SERVICE_NAME.
Troubleshooting
The app starts cleanly and emits nothing
The app starts cleanly and emits nothing
The instrumentation never loaded. In Node.js this is almost always an
import at the top of the entry file instead of --require — by the time
an import runs, the modules the hook needs to patch are already resolved.In Python, confirm you are launching through opentelemetry-instrument and
not running the interpreter directly.404 on every export
404 on every export
OTEL_EXPORTER_OTLP_ENDPOINT is a base URL. The SDK appends
/v1/traces itself, so a value already ending in /v1/traces produces
requests to /v1/traces/v1/traces.Spans from my test request are missing
Spans from my test request are missing
The process exited before the batcher flushed. Short-lived jobs, tests and
CLI tools need an explicit shutdown — in Go, the
provider.Shutdown this
page returns; in Node, sdk.shutdown().It is reliably the last batch that is lost, which is the one you were
watching for.Everything arrives under no service name
Everything arrives under no service name
OTEL_SERVICE_NAME is unset. Records still arrive and are still queryable,
but no service-level view can group them, which is where most people look
first.Next
Verify your data arrived
Confirm it landed.
Run a collector in Kubernetes
Node and cluster telemetry.