chore: Document the three OpenTelemetry setups in the migration guide - #23149
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
e0e630c to
d28ed78
Compare
nicohrubec
left a comment
There was a problem hiding this comment.
thanks for doing this, got a few comments but mostly suggestions
Co-authored-by: Nicolas Hrubec <nicolas.hrubec@outlook.com>
chargome
left a comment
There was a problem hiding this comment.
I'd trim this down generally a bit more, but LGTM otherwise
Lms24
left a comment
There was a problem hiding this comment.
Nice, this reads very clearly. I think my main points from the review are:
- we should make it clear at the beginning if a user needs to care about this section or not
- we should be consistent with "you" and "users"
Otherwise LGTM
|
|
||
| ### Better OpenTelemetry interoperability | ||
|
|
||
| Affected SDKs: Server-side SDKs (`@sentry/node` and all dependents). |
There was a problem hiding this comment.
l: Should we add this so that users/agents can quickly spot if this concerns them?
| Affected SDKs: Server-side SDKs (`@sentry/node` and all dependents). **If Sentry is used with a custom OpenTelemetry SDK Setup** |
There was a problem hiding this comment.
No this affects v11 as a whole, not just user's with custom otel setups.
|
|
||
| #### Choosing an OpenTelemetry setup | ||
|
|
||
| There are three ways to run the two together, and which one you want depends on who should own spans. This is controlled by the existing `skipOpenTelemetrySetup` option, whose default was flipped in v11: it is now `true` for most server SDKs (including `@sentry/node`, `@sentry/bun`, the serverless SDKs and `@sentry/cloudflare`) and `false` for `@sentry/nextjs` and `@sentry/sveltekit`. |
There was a problem hiding this comment.
| There are three ways to run the two together, and which one you want depends on who should own spans. This is controlled by the existing `skipOpenTelemetrySetup` option, whose default was flipped in v11: it is now `true` for most server SDKs (including `@sentry/node`, `@sentry/bun`, the serverless SDKs and `@sentry/cloudflare`) and `false` for `@sentry/nextjs` and `@sentry/sveltekit`. | |
| There are three ways to run the Sentry and OTel SDKs together, and which one you want depends on who should own spans. This is controlled by the existing `skipOpenTelemetrySetup` option, whose default was flipped in v11: it is now `true` for most server SDKs (including `@sentry/node`, `@sentry/bun`, the serverless SDKs and `@sentry/cloudflare`) and `false` for `@sentry/nextjs` and `@sentry/sveltekit`. |
| This is what `@sentry/nextjs` and `@sentry/sveltekit` do by default, because those frameworks emit OpenTelemetry spans that would otherwise be lost. | ||
|
|
||
| #### Connecting Sentry to your OpenTelemetry traces | ||
| Everything goes to Sentry and only to Sentry. This is not a general OpenTelemetry pipeline: there is no exporter, no OTLP output, and no way to fan spans out to another backend. Sentry also refuses to register its provider if you already registered one of your own, logging a warning instead. If you want a real OpenTelemetry pipeline, use setup 3. |
There was a problem hiding this comment.
very technically, and probably fine to omit here, users could still roll their own transport and fan out to other tracing backends. But I think we discussed this already so probably not worth mentioning here.
Drops the Next.js/SvelteKit note from setup 2, since setup 1 already points readers there when a library emits its own OpenTelemetry spans, and reword setup 3's opening.
Co-authored-by: Nicolas Hrubec <nicolas.hrubec@outlook.com>
Co-authored-by: Charly Gomez <charly.gomez1310@gmail.com>
Co-authored-by: Nicolas Hrubec <nicolas.hrubec@outlook.com>
Co-authored-by: Nicolas Hrubec <nicolas.hrubec@outlook.com>
The option is `tracesSampleRate`.
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
Name both SDKs in the intro, and drop the claim that spans cannot be fanned out to another backend, since a custom transport can still do that.
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
Merge develop's restructured "Better OpenTelemetry interoperability" section (three named setups, from #23149), remove the trailing TODO(v11) OpenTelemetry guide link for the user-facing alpha, and refresh the end-state copy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Restructures the "Better OpenTelemetry interoperability" section of the v11 migration guide around the three setups users can actually run, so people can find the one that matches them instead of piecing it together from prose.
@opentelemetry/apispans ignored.skipOpenTelemetrySetup: false): a minimal tracer provider picks up@opentelemetry/apispans and turns them into Sentry spans. Everything goes to Sentry and only to Sentry.otlpIntegration()for trace linking,getOtlpTracesEndpoint()to point your exporter at Sentry.Also adds an "Avoiding duplicate spans" subsection covering what happens when Sentry's instrumentation overlaps with your own, and spells out that the v10 bridge built from
SentryContextManager,SentrySamplerandSentrySpanProcessoris gone.This replaces the prose that previously covered
skipOpenTelemetrySetup, the removed bridge and the HTTP/fetch example, rather than adding alongside it. Everything unique from that block is preserved: the flipped default and per-SDK lists, and the v10 change whereskipOpenTelemetrySetup: trueno longer disables HTTP and fetch spans.Why
The old section explained the mechanism but never said which configuration a given user wants, so the common questions (does Sentry pick up my OpenTelemetry spans, do I get duplicates, where did
SentrySpanProcessorgo) had to be inferred. Naming the three setups makes that a lookup.Note this touches the same region as #23099, which adds its own OTLP integration section, so one of the two will need a rebase.