Skip to content

Commit

Permalink
feat(node): Update docs for manual OTEL setup (#10145)
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea authored May 28, 2024
1 parent c4cb26f commit 099b96e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const Sentry = require("@sentry/node");
const {
SentrySpanProcessor,
SentryPropagator,
SentryContextManager,
SentrySampler,
} = require("@sentry/opentelemetry");

Expand All @@ -78,13 +77,16 @@ provider.addSpanProcessor(new SentrySpanProcessor());
// We need a custom propagator and context manager
provier.register({
propagator: new SentryPropagator(),
contextManager: new SentryContextManager(),
contextManager: new Sentry.SentryContextManager(),
});

// We need our sampler to ensure the correct subset of traces is sent to Sentry
const provider = new BasicTracerProvider({
sampler: new SentrySampler(Sentry.getClient()),
});

// Validate that the setup is correct
Sentry.validateOpenTelemetrySetup();
```

## Using an OpenTelemetry Tracer
Expand Down

0 comments on commit 099b96e

Please sign in to comment.