diff --git a/docs/migration/v8-to-v9.md b/docs/migration/v8-to-v9.md index 6206c60cbb1f..ae2f68bb0e38 100644 --- a/docs/migration/v8-to-v9.md +++ b/docs/migration/v8-to-v9.md @@ -98,6 +98,19 @@ It will be removed in a future major version. - The `debugIntegration` has been removed. To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...). - The `sessionTimingIntegration` has been removed. To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`). +- 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()], +}); +``` ### `@sentry/react` diff --git a/packages/astro/src/index.server.ts b/packages/astro/src/index.server.ts index c5f3f74699d6..9152f67abf62 100644 --- a/packages/astro/src/index.server.ts +++ b/packages/astro/src/index.server.ts @@ -12,8 +12,6 @@ export { addEventProcessor, addIntegration, // eslint-disable-next-line deprecation/deprecation - addOpenTelemetryInstrumentation, - // eslint-disable-next-line deprecation/deprecation addRequestDataToEvent, amqplibIntegration, anrIntegration, diff --git a/packages/aws-serverless/src/index.ts b/packages/aws-serverless/src/index.ts index c50d796415e9..c40266ab59a9 100644 --- a/packages/aws-serverless/src/index.ts +++ b/packages/aws-serverless/src/index.ts @@ -114,8 +114,6 @@ export { spanToBaggageHeader, trpcMiddleware, updateSpanName, - // eslint-disable-next-line deprecation/deprecation - addOpenTelemetryInstrumentation, zodErrorsIntegration, profiler, amqplibIntegration, diff --git a/packages/bun/src/index.ts b/packages/bun/src/index.ts index 6b172c998d64..0d476efd910b 100644 --- a/packages/bun/src/index.ts +++ b/packages/bun/src/index.ts @@ -136,8 +136,6 @@ export { spanToBaggageHeader, trpcMiddleware, updateSpanName, - // eslint-disable-next-line deprecation/deprecation - addOpenTelemetryInstrumentation, zodErrorsIntegration, profiler, amqplibIntegration, diff --git a/packages/google-cloud-serverless/src/index.ts b/packages/google-cloud-serverless/src/index.ts index 2c04193da8f3..ace6ff127c3d 100644 --- a/packages/google-cloud-serverless/src/index.ts +++ b/packages/google-cloud-serverless/src/index.ts @@ -113,8 +113,6 @@ export { spanToBaggageHeader, trpcMiddleware, updateSpanName, - // eslint-disable-next-line deprecation/deprecation - addOpenTelemetryInstrumentation, zodErrorsIntegration, profiler, amqplibIntegration, diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index b4c556c39f81..bd2ae0722f87 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -58,8 +58,6 @@ export type { NodeOptions } from './types'; export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from '@sentry/core'; export { - // eslint-disable-next-line deprecation/deprecation - addOpenTelemetryInstrumentation, // These are custom variants that need to be used instead of the core one // As they have slightly different implementations continueTrace, diff --git a/packages/opentelemetry/src/index.ts b/packages/opentelemetry/src/index.ts index 30228d0dd763..ff8ec1655edd 100644 --- a/packages/opentelemetry/src/index.ts +++ b/packages/opentelemetry/src/index.ts @@ -58,8 +58,5 @@ export { export { openTelemetrySetupCheck } from './utils/setupCheck'; -// eslint-disable-next-line deprecation/deprecation -export { addOpenTelemetryInstrumentation } from './instrumentation'; - // Legacy export { getClient } from '@sentry/core'; diff --git a/packages/opentelemetry/src/instrumentation.ts b/packages/opentelemetry/src/instrumentation.ts deleted file mode 100644 index 979282d0e467..000000000000 --- a/packages/opentelemetry/src/instrumentation.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Instrumentation } from '@opentelemetry/instrumentation'; -import { registerInstrumentations } from '@opentelemetry/instrumentation'; - -/** - * This method takes an OpenTelemetry instrumentation or - * array of instrumentations and registers them with OpenTelemetry. - * - * @deprecated This method will be removed in the next major version of the SDK. - * Use the `openTelemetryInstrumentations` option in `Sentry.init()` or your custom Sentry Client instead. - */ -export function addOpenTelemetryInstrumentation(...instrumentations: Instrumentation[]): void { - registerInstrumentations({ - instrumentations, - }); -} diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index 109e76d7053f..193cbd072b39 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -16,8 +16,6 @@ export { addEventProcessor, addIntegration, // eslint-disable-next-line deprecation/deprecation - addOpenTelemetryInstrumentation, - // eslint-disable-next-line deprecation/deprecation addRequestDataToEvent, amqplibIntegration, anrIntegration, diff --git a/packages/solidstart/src/server/index.ts b/packages/solidstart/src/server/index.ts index b0554463f427..4963104f7d4e 100644 --- a/packages/solidstart/src/server/index.ts +++ b/packages/solidstart/src/server/index.ts @@ -8,8 +8,6 @@ export { addEventProcessor, addIntegration, // eslint-disable-next-line deprecation/deprecation - addOpenTelemetryInstrumentation, - // eslint-disable-next-line deprecation/deprecation addRequestDataToEvent, amqplibIntegration, anrIntegration, diff --git a/packages/sveltekit/src/server/index.ts b/packages/sveltekit/src/server/index.ts index ff31b715768f..cbd4934744bf 100644 --- a/packages/sveltekit/src/server/index.ts +++ b/packages/sveltekit/src/server/index.ts @@ -8,8 +8,6 @@ export { addEventProcessor, addIntegration, // eslint-disable-next-line deprecation/deprecation - addOpenTelemetryInstrumentation, - // eslint-disable-next-line deprecation/deprecation addRequestDataToEvent, amqplibIntegration, anrIntegration,