feat(server-utils): Add otlpIntegration to connect Sentry to an existing OpenTelemetry setup - #23099
Open
andreiborza wants to merge 5 commits into
Open
feat(server-utils): Add otlpIntegration to connect Sentry to an existing OpenTelemetry setup#23099andreiborza wants to merge 5 commits into
otlpIntegration to connect Sentry to an existing OpenTelemetry setup#23099andreiborza wants to merge 5 commits into
Conversation
…sting OpenTelemetry setup Adds `otlpIntegration()` and `getOtlpTracesEndpoint()` to `@sentry/server-utils`, re-exported from the server SDKs so no extra install or import is needed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d4fb98a. Configure here.
Logs, metrics and check-ins already flow through the same trace context as errors. Assert it end-to-end and say so in the integration's docs.
OpenTelemetry returns a span wrapping INVALID_SPAN_CONTEXT when tracing is suppressed or when a span is started before a tracer provider is registered. Its all-zero ids were being stamped onto everything Sentry sends, breaking trace linkage instead of falling back to the Sentry scope.
Astro's server entry cannot `export * from '@sentry/node'` (Vite moves the exports onto `default` in prod builds), so it enumerates them. The node-exports-test-app E2E check caught the gap.
andreiborza
marked this pull request as ready for review
August 6, 2026 14:41
andreiborza
requested review from
JPeer264,
Lms24,
chargome,
isaacs,
mydea,
nicohrubec and
s1gr1d
and removed request for
a team,
isaacs,
mydea and
s1gr1d
August 6, 2026 14:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Adds
otlpIntegration()to@sentry/server-utils, re-exported from the server SDKs so it works with no extra install and no extra import.Sentry.otlpIntegration()takes no options. Everything Sentry sends that carries trace information (errors, logs, metrics, check-ins) is attached to whatever OpenTelemetry span is active, so it lands on the same trace as the spans your own OpenTelemetry SDK exports.Sentry.getOtlpTracesEndpoint(dsn)returns the URL and auth headers for Sentry's OTLP traces endpoint, to configure your ownOTLPTraceExporterwith.export * from '@sentry/node'.node-express-otlpE2E app covering a real OpenTelemetry Node SDK setup end to end.The integration does not set up a span exporter, span processor, or tracer provider. Users keep full ownership of their OpenTelemetry pipeline. Outgoing request propagation is left to their OpenTelemetry propagator, and an active Sentry span still takes precedence, so this only changes behavior when Sentry has no span of its own.
Why
Users running their own OpenTelemetry setup had no supported way to correlate Sentry telemetry with their OpenTelemetry traces. The integration lives in
@sentry/server-utilsbecause it is the shared base for every server SDK and no browser SDK, so@opentelemetry/apireaches exactly the packages that can use it and never@sentry/browser. Putting it in@sentry/corewas rejected: core is not a package users depend on directly, so@sentry/core/otlpwould not resolve under pnpm, and core would own an@opentelemetry/apiversion range on behalf of every browser and edge user.Closes: #23082