Skip to content

Commit 6038628

Browse files
authored
feat(core)!: Remove addOpenTelemetryInstrumentation method (#14792)
The `addOpenTelemetryInstrumentation` method has been removed. Use the `openTelemetryInstrumentations` option in `Sentry.init()` or your custom Sentry Client instead. ```js import * as Sentry from '@sentry/node'; // before Sentry.addOpenTelemetryInstrumentation(new GenericPoolInstrumentation()); // after Sentry.init({ openTelemetryInstrumentations: [new GenericPoolInstrumentation()], }); ```
1 parent a2562e2 commit 6038628

File tree

11 files changed

+13
-34
lines changed

11 files changed

+13
-34
lines changed

docs/migration/v8-to-v9.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ It will be removed in a future major version.
9898

9999
- The `debugIntegration` has been removed. To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...).
100100
- The `sessionTimingIntegration` has been removed. To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`).
101+
- The `addOpenTelemetryInstrumentation` method has been removed. Use the `openTelemetryInstrumentations` option in `Sentry.init()` or your custom Sentry Client instead.
102+
103+
```js
104+
import * as Sentry from '@sentry/node';
105+
106+
// before
107+
Sentry.addOpenTelemetryInstrumentation(new GenericPoolInstrumentation());
108+
109+
// after
110+
Sentry.init({
111+
openTelemetryInstrumentations: [new GenericPoolInstrumentation()],
112+
});
113+
```
101114

102115
### `@sentry/react`
103116

packages/astro/src/index.server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ export {
1212
addEventProcessor,
1313
addIntegration,
1414
// eslint-disable-next-line deprecation/deprecation
15-
addOpenTelemetryInstrumentation,
16-
// eslint-disable-next-line deprecation/deprecation
1715
addRequestDataToEvent,
1816
amqplibIntegration,
1917
anrIntegration,

packages/aws-serverless/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ export {
114114
spanToBaggageHeader,
115115
trpcMiddleware,
116116
updateSpanName,
117-
// eslint-disable-next-line deprecation/deprecation
118-
addOpenTelemetryInstrumentation,
119117
zodErrorsIntegration,
120118
profiler,
121119
amqplibIntegration,

packages/bun/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ export {
136136
spanToBaggageHeader,
137137
trpcMiddleware,
138138
updateSpanName,
139-
// eslint-disable-next-line deprecation/deprecation
140-
addOpenTelemetryInstrumentation,
141139
zodErrorsIntegration,
142140
profiler,
143141
amqplibIntegration,

packages/google-cloud-serverless/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ export {
113113
spanToBaggageHeader,
114114
trpcMiddleware,
115115
updateSpanName,
116-
// eslint-disable-next-line deprecation/deprecation
117-
addOpenTelemetryInstrumentation,
118116
zodErrorsIntegration,
119117
profiler,
120118
amqplibIntegration,

packages/node/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ export type { NodeOptions } from './types';
5858
export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from '@sentry/core';
5959

6060
export {
61-
// eslint-disable-next-line deprecation/deprecation
62-
addOpenTelemetryInstrumentation,
6361
// These are custom variants that need to be used instead of the core one
6462
// As they have slightly different implementations
6563
continueTrace,

packages/opentelemetry/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,5 @@ export {
5858

5959
export { openTelemetrySetupCheck } from './utils/setupCheck';
6060

61-
// eslint-disable-next-line deprecation/deprecation
62-
export { addOpenTelemetryInstrumentation } from './instrumentation';
63-
6461
// Legacy
6562
export { getClient } from '@sentry/core';

packages/opentelemetry/src/instrumentation.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/remix/src/index.server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ export {
1616
addEventProcessor,
1717
addIntegration,
1818
// eslint-disable-next-line deprecation/deprecation
19-
addOpenTelemetryInstrumentation,
20-
// eslint-disable-next-line deprecation/deprecation
2119
addRequestDataToEvent,
2220
amqplibIntegration,
2321
anrIntegration,

packages/solidstart/src/server/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export {
88
addEventProcessor,
99
addIntegration,
1010
// eslint-disable-next-line deprecation/deprecation
11-
addOpenTelemetryInstrumentation,
12-
// eslint-disable-next-line deprecation/deprecation
1311
addRequestDataToEvent,
1412
amqplibIntegration,
1513
anrIntegration,

packages/sveltekit/src/server/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export {
88
addEventProcessor,
99
addIntegration,
1010
// eslint-disable-next-line deprecation/deprecation
11-
addOpenTelemetryInstrumentation,
12-
// eslint-disable-next-line deprecation/deprecation
1311
addRequestDataToEvent,
1412
amqplibIntegration,
1513
anrIntegration,

0 commit comments

Comments
 (0)