Sentry with OTel
Learn how to link Sentry SDK traces with OpenTelemetry instrumented services.
If you're using both Sentry SDKs and OpenTelemetry instrumentation, you can link them together for end-to-end distributed tracing.
If you have a Sentry SDK on your frontend or mobile app making requests to an OTLP-instrumented backend, enable propagateTraceparent in your SDK initialization to link them into a single distributed trace. This sends the W3C traceparent header with outgoing requests, which your OTLP-instrumented backend will pick up and continue.
This gives you end-to-end visibility:
Tail-Based Sampling Interaction
When propagateTraceparent is enabled, the frontend SDK encodes its sampling decision in the traceparent header. If your OTel backend uses a parentbased_* sampler (the default is parentbased_always_on), it honors that decision and skips your collector's tail-based sampler entirely.
To preserve tail-based sampling, set your backend's sampler to always_on so all spans reach the collector for evaluation:
OTEL_TRACES_SAMPLER=always_on
The following SDKs support the propagateTraceparent option:
If you're running both a Sentry SDK and OTel instrumentation in the same backend service, use the OTLP Integration. It sends your OTel spans to Sentry and ensures errors and logs are linked to the right traces.
The OTLP Integration configures two things: an exporter that sends your OTel spans to Sentry, and event linking that attaches Sentry errors and logs to the active OTel trace. This is what makes an error show up on the right span in the trace waterfall.
Cross-service trace propagation — making Service A and Service B appear in the same distributed trace — is a separate concern handled by OTel's default W3C traceparent propagator. This is already active in any standard OTel SDK setup, so traces connect across services without additional Sentry configuration.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").