Skip to content

Commit

Permalink
Use addOpenTelemetryInstrumentation method (#10398)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad authored Jun 13, 2024
1 parent 2a0dcb6 commit 24fade4
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const Sentry = require("@sentry/node");
const {
GenericPoolInstrumentation,
} = require("@opentelemetry/instrumentation-generic-pool");
const { registerInstrumentations } = require("@opentelemetry/instrumentation");

Sentry.init({
dsn: "__DSN__",
Expand All @@ -39,9 +38,7 @@ Sentry.init({
});

// Afterwards, you can add additional instrumentation:
registerInstrumentations({
instrumentations: [new GenericPoolInstrumentation()],
});
Sentry.addOpenTelemetryInstrumentation(new GenericPoolInstrumentation());
```

Any instrumentation added like this will be automatically picked up by Sentry.
Expand Down

0 comments on commit 24fade4

Please sign in to comment.