Skip to content

Commit 46e0cb4

Browse files
andreiborzaclaude
andauthored
feat(server-utils)!: Rename otlpIntegration to openTelemetryIntegration (#23938)
## What Renames `otlpIntegration()` to `openTelemetryIntegration()`, reporting itself as `OpenTelemetry` instead of `Otlp`. `getOtlpTracesEndpoint()` keeps its name, since it really does derive Sentry's OTLP traces endpoint from the DSN. ## Why The old name suggested the integration sends data over OTLP. It sends nothing: it sets up no exporter, no span processor and no tracer provider, and only connects what Sentry sends to the active OpenTelemetry span. Closes: #23937 Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 345f7cd commit 46e0cb4

16 files changed

Lines changed: 51 additions & 35 deletions

File tree

MIGRATION.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Spans go to Sentry. This is not a general OpenTelemetry pipeline: there is no ex
119119

120120
##### 3. Your own OpenTelemetry, Sentry linked to it
121121

122-
Turn Sentry tracing off, run your own OpenTelemetry setup, and add the Sentry `otlpIntegration()`. Leave `enableOpenTelemetrySetup` unset or set it to `false`:
122+
Turn Sentry tracing off, run your own OpenTelemetry setup, and add the Sentry `openTelemetryIntegration()`. Leave `enableOpenTelemetrySetup` unset or set it to `false`:
123123

124124
```js
125125
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
@@ -136,13 +136,13 @@ provider.register();
136136
Sentry.init({
137137
dsn: '__DSN__',
138138
// no tracesSampleRate: OpenTelemetry owns spans, Sentry owns errors and logs
139-
integrations: [Sentry.otlpIntegration()],
139+
integrations: [Sentry.openTelemetryIntegration()],
140140
});
141141
```
142142

143143
`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.
144144

145-
Spans are completely managed by your OpenTelemetry setup and the two pipelines stay separate: Sentry sends no spans, and no Sentry span is exported to your OpenTelemetry pipeline. 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.
145+
Spans are completely managed by your OpenTelemetry setup and the two pipelines stay separate: Sentry sends no spans, and no Sentry span is exported to your OpenTelemetry pipeline. Sentry captures errors and logs, and the Sentry `openTelemetryIntegration()` 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.
146146

147147
Sentry does not touch your pipeline: no exporter, no span processor, no tracer provider, and outgoing trace propagation is left to your propagator. See [Connecting Sentry to your OpenTelemetry traces](#connecting-sentry-to-your-opentelemetry-traces) for the details, including what changed if you used the v10 integration.
148148

@@ -158,13 +158,13 @@ In v10, running your own OpenTelemetry setup meant registering Sentry's own comp
158158

159159
#### Connecting Sentry to your OpenTelemetry traces
160160

161-
`Sentry.otlpIntegration()` attaches everything Sentry sends that carries trace information (errors, logs, metrics and crons) to the OpenTelemetry span that is active when it happens. It takes no options, and is available from every server-side SDK, so there is nothing extra to install or import. See [setup 3](#3-your-own-opentelemetry-sentry-linked-to-it) above for a complete example.
161+
`Sentry.openTelemetryIntegration()` attaches everything Sentry sends that carries trace information (errors, logs, metrics and crons) to the OpenTelemetry span that is active when it happens. It takes no options, and is available from every server-side SDK, so there is nothing extra to install or import. See [setup 3](#3-your-own-opentelemetry-sentry-linked-to-it) above for a complete example.
162162

163163
It does not set up a span exporter, span processor, or tracer provider. You keep full ownership of your OpenTelemetry pipeline, and outgoing request propagation is left to your OpenTelemetry propagator. To send your spans to Sentry, point your own exporter at the URL and auth headers that `Sentry.getOtlpTracesEndpoint()` derives from your DSN.
164164

165165
An active Sentry span still takes precedence, so this only changes what happens when Sentry has no span of its own, which is the usual setup when OpenTelemetry owns tracing.
166166

167-
If you used the v10 integration from `@sentry/node-core/light/otlp`, three things changed: it moved to the main export of every server SDK, it [no longer sets up an exporter for you and lost its options](#3-removed-apis), and it [reports itself as `Otlp` rather than `OtlpIntegration`](#otlpintegration-integration-renamed-to-otlp). Configure your own exporter as shown in setup 3, pointing it at your collector's URL if you route through one.
167+
If you used the v10 integration from `@sentry/node-core/light/otlp`, three things changed: it moved to the main export of every server SDK, it [no longer sets up an exporter for you and lost its options](#3-removed-apis), and it [was renamed to `openTelemetryIntegration()`](#otlpintegration-renamed-to-opentelemetryintegration). Configure your own exporter as shown in setup 3, pointing it at your collector's URL if you route through one.
168168

169169
### `sendDefaultPii` is replaced by `dataCollection`
170170

@@ -1366,8 +1366,8 @@ The `idleTimeout`, `finalTimeout` and `childSpanTimeout` options of interaction
13661366
- (Express) The `shouldHandleError` option was removed from `setupExpressErrorHandler` and `expressErrorHandler`, along with the `ExpressHandlerOptions` type. Configure it on `expressIntegration()` instead. See [Express: errors are captured automatically](#express-errors-are-captured-automatically).
13671367
- (Express) `ExpressIntegrationOptions` is no longer exported from `@sentry/core`. Import it from `@sentry/node` instead — that version is the one `expressIntegration()` accepts, and it carries `shouldHandleError`.
13681368
- (Fastify) The deprecated `instrumentFastify` and `handleFastifyError` exports were removed. `fastifyIntegration` now instruments Fastify (v3.21–v5) and captures errors on its own, so neither export is needed. See [Fastify: `setupFastifyErrorHandler` is deprecated](#fastify-setupfastifyerrorhandler-is-deprecated).
1369-
- The `@sentry/node-core/light/otlp` entry point was removed, along with its optional `@opentelemetry/exporter-trace-otlp-http` peer dependency. `otlpIntegration` is now exported directly from every server-side SDK, so `Sentry.otlpIntegration()` needs no extra import or install.
1370-
- The `otlpIntegration` options `setupOtlpTracesExporter` and `collectorUrl` were removed, and the integration no longer sets up a span exporter, span processor, or tracer provider. Configure your own exporter and point it at `Sentry.getOtlpTracesEndpoint(dsn)`, or at your collector's URL if you route through one. See [Connecting Sentry to your OpenTelemetry traces](#connecting-sentry-to-your-opentelemetry-traces).
1369+
- The `@sentry/node-core/light/otlp` entry point was removed, along with its optional `@opentelemetry/exporter-trace-otlp-http` peer dependency. `openTelemetryIntegration` is now exported directly from every server-side SDK, so `Sentry.openTelemetryIntegration()` needs no extra import or install.
1370+
- The `setupOtlpTracesExporter` and `collectorUrl` options were removed, and the integration no longer sets up a span exporter, span processor, or tracer provider. Configure your own exporter and point it at `Sentry.getOtlpTracesEndpoint(dsn)`, or at your collector's URL if you route through one. See [Connecting Sentry to your OpenTelemetry traces](#connecting-sentry-to-your-opentelemetry-traces).
13711371
- The deprecated `httpServerSpansIntegration` `instrumentation.{requestHook,responseHook,applyCustomAttributesOnSpan}` option was removed. Use `onSpanCreated` instead. `httpServerSpansIntegration` only covers incoming requests; the outgoing hooks (`outgoingRequestHook`, `outgoingResponseHook`, `outgoingRequestApplyCustomAttributes`) are on `httpIntegration`.
13721372
13731373
#### `httpIntegration` options were consolidated
@@ -1962,11 +1962,27 @@ Sentry.denoHttpIntegration({
19621962
});
19631963
```
19641964
1965-
### `OtlpIntegration` integration renamed to `Otlp`
1965+
### `otlpIntegration` renamed to `openTelemetryIntegration`
19661966
19671967
Affected SDKs: Server-side SDKs (`@sentry/node` and all dependents).
19681968
1969-
The OTLP integration reports itself as `Otlp` rather than `OtlpIntegration`, matching every other integration in the SDKs, none of which carry an `Integration` suffix in their name. The `otlpIntegration()` export itself is unchanged. This only matters if you reference the integration by name:
1969+
The old name was misleading: the integration sends nothing over OTLP. It sets up no exporter, no span processor and no tracer provider, and only connects what Sentry sends to your OpenTelemetry traces.
1970+
1971+
```js
1972+
// before
1973+
Sentry.init({
1974+
integrations: [Sentry.otlpIntegration()],
1975+
});
1976+
1977+
// after
1978+
Sentry.init({
1979+
integrations: [Sentry.openTelemetryIntegration()],
1980+
});
1981+
```
1982+
1983+
`getOtlpTracesEndpoint()` keeps its name. That helper really is about OTLP: it derives the URL and auth headers of Sentry's OTLP traces endpoint from your DSN.
1984+
1985+
The integration also reports itself as `OpenTelemetry` rather than `OtlpIntegration`, which matters if you reference it by name:
19701986
19711987
```js
19721988
// before
@@ -1976,7 +1992,7 @@ Sentry.init({
19761992

19771993
// after
19781994
Sentry.init({
1979-
integrations: integrations => integrations.filter(integration => integration.name !== 'Otlp'),
1995+
integrations: integrations => integrations.filter(integration => integration.name !== 'OpenTelemetry'),
19801996
});
19811997
```
19821998

dev-packages/e2e-tests/test-applications/nextjs-otlp/sentry.server.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ Sentry.init({
1212
enableOpenTelemetrySetup: false,
1313

1414
// Puts the active OpenTelemetry span's trace on everything Sentry sends.
15-
integrations: [Sentry.otlpIntegration()],
15+
integrations: [Sentry.openTelemetryIntegration()],
1616
});

dev-packages/e2e-tests/test-applications/node-express-otlp/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Sentry.init({
3535
dsn,
3636
debug: !!process.env.DEBUG,
3737
tunnel: `http://localhost:3031/`, // proxy server
38-
integrations: [Sentry.otlpIntegration()],
38+
integrations: [Sentry.openTelemetryIntegration()],
3939
});
4040

4141
interface ExportedTrace {

dev-packages/e2e-tests/test-applications/node-otel-sdk-node/src/instrument.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ Sentry.init({
2828
debug: !!process.env.DEBUG,
2929
tunnel: `http://localhost:3031/`, // proxy server
3030
// no tracesSampleRate: OpenTelemetry owns spans, Sentry owns errors and logs
31-
integrations: [Sentry.otlpIntegration()],
31+
integrations: [Sentry.openTelemetryIntegration()],
3232
});

packages/astro/src/index.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export {
9999
postgresIntegration,
100100
postgresJsIntegration,
101101
prismaIntegration,
102-
otlpIntegration,
102+
openTelemetryIntegration,
103103
getOtlpTracesEndpoint,
104104
processSessionIntegration,
105105
childProcessIntegration,

packages/aws-serverless/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export {
119119
postgresJsIntegration,
120120
processSessionIntegration,
121121
prismaIntegration,
122-
otlpIntegration,
122+
openTelemetryIntegration,
123123
getOtlpTracesEndpoint,
124124
childProcessIntegration,
125125
workerThreadsIntegration,

packages/bun/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export {
139139
postgresIntegration,
140140
postgresJsIntegration,
141141
prismaIntegration,
142-
otlpIntegration,
142+
openTelemetryIntegration,
143143
getOtlpTracesEndpoint,
144144
processSessionIntegration,
145145
hapiIntegration,

packages/cloudflare/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export { httpServerIntegration } from './integrations/httpServer';
120120
export { fetchIntegration } from './integrations/fetch';
121121
export { spotlightIntegration } from './integrations/spotlight';
122122
export {
123-
otlpIntegration,
123+
openTelemetryIntegration,
124124
getOtlpTracesEndpoint,
125125
prismaIntegration,
126126
instrumentOpenAiClient,

packages/core/src/carrier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface SentryCarrier {
4343
/** Strategy for assembling segment spans into transactions; set by SDKs that defer capture. */
4444
segmentSpanCaptureStrategy?: SegmentSpanCaptureStrategy;
4545

46-
/** Supplies trace context from a non-Sentry source (e.g. OpenTelemetry); set by `otlpIntegration`. */
46+
/** Supplies trace context from a non-Sentry source (e.g. OpenTelemetry); set by `openTelemetryIntegration`. */
4747
externalPropagationContextProvider?: () => { traceId: string; spanId: string } | undefined;
4848

4949
/** Overwrites TextEncoder used in `@sentry/core`, need for `react-native@0.73` and older */

packages/deno/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export {
142142
postgresJsIntegration,
143143
tediousIntegration,
144144
} from '@sentry/server-utils';
145-
export { otlpIntegration, getOtlpTracesEndpoint } from '@sentry/server-utils/no-diagnostic-channels';
145+
export { openTelemetryIntegration, getOtlpTracesEndpoint } from '@sentry/server-utils/no-diagnostic-channels';
146146
// Deprecated aliases kept for back-compat. Each forwards to the shared
147147
// integration above, so its name is the shared name (e.g. `Mysql`), not the old
148148
// `Deno*` name. See each alias's `@deprecated` note.

0 commit comments

Comments
 (0)