Skip to content

Commit

Permalink
feat(core)!: Remove addOpenTelemetryInstrumentation method (#14792)
Browse files Browse the repository at this point in the history
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()],
});
```
  • Loading branch information
AbhiPrasad authored Dec 19, 2024
1 parent a2562e2 commit 6038628
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 34 deletions.
13 changes: 13 additions & 0 deletions docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 0 additions & 2 deletions packages/astro/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export {
addEventProcessor,
addIntegration,
// eslint-disable-next-line deprecation/deprecation
addOpenTelemetryInstrumentation,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
amqplibIntegration,
anrIntegration,
Expand Down
2 changes: 0 additions & 2 deletions packages/aws-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ export {
spanToBaggageHeader,
trpcMiddleware,
updateSpanName,
// eslint-disable-next-line deprecation/deprecation
addOpenTelemetryInstrumentation,
zodErrorsIntegration,
profiler,
amqplibIntegration,
Expand Down
2 changes: 0 additions & 2 deletions packages/bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ export {
spanToBaggageHeader,
trpcMiddleware,
updateSpanName,
// eslint-disable-next-line deprecation/deprecation
addOpenTelemetryInstrumentation,
zodErrorsIntegration,
profiler,
amqplibIntegration,
Expand Down
2 changes: 0 additions & 2 deletions packages/google-cloud-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ export {
spanToBaggageHeader,
trpcMiddleware,
updateSpanName,
// eslint-disable-next-line deprecation/deprecation
addOpenTelemetryInstrumentation,
zodErrorsIntegration,
profiler,
amqplibIntegration,
Expand Down
2 changes: 0 additions & 2 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions packages/opentelemetry/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
15 changes: 0 additions & 15 deletions packages/opentelemetry/src/instrumentation.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/remix/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export {
addEventProcessor,
addIntegration,
// eslint-disable-next-line deprecation/deprecation
addOpenTelemetryInstrumentation,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
amqplibIntegration,
anrIntegration,
Expand Down
2 changes: 0 additions & 2 deletions packages/solidstart/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export {
addEventProcessor,
addIntegration,
// eslint-disable-next-line deprecation/deprecation
addOpenTelemetryInstrumentation,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
amqplibIntegration,
anrIntegration,
Expand Down
2 changes: 0 additions & 2 deletions packages/sveltekit/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export {
addEventProcessor,
addIntegration,
// eslint-disable-next-line deprecation/deprecation
addOpenTelemetryInstrumentation,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
amqplibIntegration,
anrIntegration,
Expand Down

0 comments on commit 6038628

Please sign in to comment.