Skip to content

Default most SDKs to a no-tracer-provider setup; opt-in flag to enable it #22486

Description

@andreiborza

Today @sentry/node (and everything built on it) always installs an OpenTelemetry tracer provider + context strategy via initOpenTelemetry. For v11 we want to flip the default: most SDKs should run without a tracer provider (core startSpan APIs + an AsyncLocalStorage context strategy for scope isolation, i.e. the old node-core/light model), and only the SDKs that genuinely need OTel span pickup (Next.js, SvelteKit) should default to the full tracer-provider setup.

Users on any SDK must still be able to opt into a tracer provider when they want OTel spans surfaced in Sentry. We need to decide whether to introduce a new flag or reuse/rename an existing one, and settle the default per SDK.

Considerations

  • Existing related options: skipOpenTelemetrySetup, openTelemetryBasicTracerProvider, openTelemetrySpanProcessors. Prefer reusing/reframing over adding a fourth overlapping flag if we can.
  • Default matrix: node / bun / aws-serverless / google-cloud-serverless / etc. → no tracer provider; nextjs / sveltekit → tracer provider. Confirm the full list.
  • Requires an AsyncLocalStorage-based async context strategy available in @sentry/node (the one deleted with node-core/light) for the no-provider default.
  • This is the mechanism that unblocks the @sentry/effect async-context fix and the "light mode achievable with the regular node SDK" goal stated in ref(node): Merge @sentry/node-core back into @sentry/node #22418.

Acceptance criteria

  • Documented flag (new or reused) controlling tracer-provider setup, with per-SDK defaults implemented.
  • nextjs/sveltekit default to tracer provider; other server SDKs default to none.
  • Opt-in path verified to pick up OTel spans in Sentry.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions