You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: Replace skipOpenTelemetrySetup with enableOpenTelemetrySetup (#23199)
## What
Replace the `skipOpenTelemetrySetup` option with
`enableOpenTelemetrySetup: boolean` (inverted meaning, per-package
behavior unchanged).
* `@sentry/node`, `@sentry/cloudflare`: defaults to `false` (no Sentry
tracer provider)exit
* `@sentry/nextjs`, `@sentry/sveltekit`: pass `true` since they own OTel
spans by default
* `@sentry/deno`, `@sentry/vercel-edge`: keep OTel setup on by default,
so the flag defaults to `true` there
* Migration docs updated to document the rename; historical v8/v9 docs
and changelog left untouched
## Why
Since v11 most server SDKs no longer set up OpenTelemetry by default, so
the option is now an opt-in and a positive `enable` flag reads clearer
than the double negative `skip: false`. The nextjs tunnel-drop check
only bails on an explicit `false` so edge clients without the merged
node default keep processing spans as before.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: MIGRATION.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ If you only use the Sentry SDK, day-to-day tracing remains **unchanged**.
84
84
85
85
#### Choosing an OpenTelemetry setup
86
86
87
-
There are three ways to run the Sentry and OpenTelemetry 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`.
87
+
There are three ways to run the Sentry and OpenTelemetry SDKs together, and which one you want depends on who should own spans. This is controlled by the new `enableOpenTelemetrySetup` option, which replaces v10's `skipOpenTelemetrySetup` with inverted meaning (`skipOpenTelemetrySetup: true` becomes `enableOpenTelemetrySetup: false`). It defaults to `false` for most server SDKs (including `@sentry/node`, `@sentry/bun`, the serverless SDKs and `@sentry/cloudflare`) and `true` for `@sentry/nextjs` and `@sentry/sveltekit`.
88
88
89
89
##### 1. Sentry only
90
90
@@ -101,13 +101,13 @@ If a library you depend on emits its own OpenTelemetry spans and you want those
101
101
102
102
##### 2. OpenTelemetry-compatible mode, everything goes to Sentry
103
103
104
-
Set `skipOpenTelemetrySetup: false`:
104
+
Set `enableOpenTelemetrySetup: true`:
105
105
106
106
```js
107
107
Sentry.init({
108
108
dsn:'__DSN__',
109
109
tracesSampleRate:1.0,
110
-
skipOpenTelemetrySetup:false,
110
+
enableOpenTelemetrySetup:true,
111
111
});
112
112
```
113
113
@@ -117,7 +117,7 @@ Spans go to Sentry. This is not a general OpenTelemetry pipeline: there is no ex
117
117
118
118
##### 3. Your own OpenTelemetry, Sentry linked to it
119
119
120
-
Leave `skipOpenTelemetrySetup` unset or set it to `true`, turn Sentry tracing off, use your own OpenTelemetry setup, and add the Sentry `otlpIntegration()`:
120
+
Leave `enableOpenTelemetrySetup` unset or set it to `false`, turn Sentry tracing off, use your own OpenTelemetry setup, and add the Sentry `otlpIntegration()`:
`skipOpenTelemetrySetup` already defaults to `true` on most server SDKs, so there is nothing to set. On `@sentry/nextjs` and `@sentry/sveltekit` it defaults to `false`, so you have to set it explicitly. Otherwise Sentry registers its own tracer provider and you end up in setup 2 rather than this one.
141
+
`enableOpenTelemetrySetup` already defaults to `false` on most server SDKs, so there is nothing to set. On `@sentry/nextjs` and `@sentry/sveltekit` it defaults to `true`, so you have to set it to `false` explicitly. Otherwise Sentry registers its own tracer provider and you end up in setup 2 rather than this one.
142
142
143
143
OpenTelemetry owns spans end to end. Sentry captures errors and logs, and the Sentry `otlpIntegration()` attaches them to the active OpenTelemetry span so all your telemetry is connected in one trace. `getOtlpTracesEndpoint()` turns your DSN into the URL and auth headers for Sentry's OTLP endpoint, so you can point your own exporter at Sentry, at your own collector, or at both.
144
144
@@ -148,7 +148,7 @@ Sentry does not touch your pipeline: no exporter, no span processor, no tracer p
148
148
149
149
Sentry instruments many of the same libraries OpenTelemetry does (Express, Postgres, Redis, Prisma, Kafka and so on), so enabling Sentry tracing on top of your own instrumentation gives you two spans for every operation. Leave `tracesSampleRate` in your `Sentry.init` unset to avoid duplicate spans. With tracing off, Sentry's instrumentation stays installed and keeps isolating requests, but emits no spans.
150
150
151
-
Note that this changed since v10, where setting `skipOpenTelemetrySetup: true` also turned Sentry's HTTP and fetch spans off by default. Sentry now emits those whenever tracing is enabled, regardless of `skipOpenTelemetrySetup`.
151
+
Note that this changed since v10, where setting `skipOpenTelemetrySetup: true` also turned Sentry's HTTP and fetch spans off by default. Sentry now emits those whenever tracing is enabled, regardless of `enableOpenTelemetrySetup`.
152
152
153
153
If you do want Sentry spans alongside your own, keep `tracesSampleRate` set and drop the integrations that overlap. HTTP and fetch are the exception: turn off only their spans, because `httpIntegration` also provides request isolation, request data and session tracking:
Copy file name to clipboardExpand all lines: docs/migration/v11-end-state.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ If you only use the Sentry SDK, day-to-day tracing remains **unchanged**.
88
88
89
89
#### Choosing an OpenTelemetry setup
90
90
91
-
There are three ways to run the Sentry and OpenTelemetry 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`.
91
+
There are three ways to run the Sentry and OpenTelemetry SDKs together, and which one you want depends on who should own spans. This is controlled by the new `enableOpenTelemetrySetup` option, which replaces v10's `skipOpenTelemetrySetup` with inverted meaning (`skipOpenTelemetrySetup: true` becomes `enableOpenTelemetrySetup: false`). It defaults to `false` for most server SDKs (including `@sentry/node`, `@sentry/bun`, the serverless SDKs and `@sentry/cloudflare`) and `true` for `@sentry/nextjs` and `@sentry/sveltekit`.
92
92
93
93
##### 1. Sentry only
94
94
@@ -105,13 +105,13 @@ If a library you depend on emits its own OpenTelemetry spans and you want those
105
105
106
106
##### 2. OpenTelemetry-compatible mode, everything goes to Sentry
107
107
108
-
Set `skipOpenTelemetrySetup: false`:
108
+
Set `enableOpenTelemetrySetup: true`:
109
109
110
110
```js
111
111
Sentry.init({
112
112
dsn:'__DSN__',
113
113
tracesSampleRate:1.0,
114
-
skipOpenTelemetrySetup:false,
114
+
enableOpenTelemetrySetup:true,
115
115
});
116
116
```
117
117
@@ -121,7 +121,7 @@ Spans go to Sentry. This is not a general OpenTelemetry pipeline: there is no ex
121
121
122
122
##### 3. Your own OpenTelemetry, Sentry linked to it
123
123
124
-
Leave `skipOpenTelemetrySetup` unset or set it to `true`, turn Sentry tracing off, use your own OpenTelemetry setup, and add the Sentry `otlpIntegration()`:
124
+
Leave `enableOpenTelemetrySetup` unset or set it to `false`, turn Sentry tracing off, use your own OpenTelemetry setup, and add the Sentry `otlpIntegration()`:
`skipOpenTelemetrySetup` already defaults to `true` on most server SDKs, so there is nothing to set. On `@sentry/nextjs` and `@sentry/sveltekit` it defaults to `false`, so you have to set it explicitly. Otherwise Sentry registers its own tracer provider and you end up in setup 2 rather than this one.
145
+
`enableOpenTelemetrySetup` already defaults to `false` on most server SDKs, so there is nothing to set. On `@sentry/nextjs` and `@sentry/sveltekit` it defaults to `true`, so you have to set it to `false` explicitly. Otherwise Sentry registers its own tracer provider and you end up in setup 2 rather than this one.
146
146
147
147
OpenTelemetry owns spans end to end. Sentry captures errors and logs, and the Sentry `otlpIntegration()` attaches them to the active OpenTelemetry span so all your telemetry is connected in one trace. `getOtlpTracesEndpoint()` turns your DSN into the URL and auth headers for Sentry's OTLP endpoint, so you can point your own exporter at Sentry, at your own collector, or at both.
148
148
@@ -152,7 +152,7 @@ Sentry does not touch your pipeline: no exporter, no span processor, no tracer p
152
152
153
153
Sentry instruments many of the same libraries OpenTelemetry does (Express, Postgres, Redis, Prisma, Kafka and so on), so enabling Sentry tracing on top of your own instrumentation gives you two spans for every operation. Leave `tracesSampleRate` in your `Sentry.init` unset to avoid duplicate spans. With tracing off, Sentry's instrumentation stays installed and keeps isolating requests, but emits no spans.
154
154
155
-
Note that this changed since v10, where setting `skipOpenTelemetrySetup: true` also turned Sentry's HTTP and fetch spans off by default. Sentry now emits those whenever tracing is enabled, regardless of `skipOpenTelemetrySetup`.
155
+
Note that this changed since v10, where setting `skipOpenTelemetrySetup: true` also turned Sentry's HTTP and fetch spans off by default. Sentry now emits those whenever tracing is enabled, regardless of `enableOpenTelemetrySetup`.
156
156
157
157
If you do want Sentry spans alongside your own, keep `tracesSampleRate` set and drop the integrations that overlap. HTTP and fetch are the exception: turn off only their spans, because `httpIntegration` also provides request isolation, request data and session tracking:
0 commit comments