From f306fcc9c30b96226ccf159cff6bbe8044191379 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 28 May 2024 08:39:12 +0200 Subject: [PATCH] feat(node): Update docs for manual OTEL setup (#10145) --- .../common/performance/instrumentation/opentelemetry.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/common/performance/instrumentation/opentelemetry.mdx b/docs/platforms/javascript/common/performance/instrumentation/opentelemetry.mdx index f0a6978aafeda6..35277f865b9be6 100644 --- a/docs/platforms/javascript/common/performance/instrumentation/opentelemetry.mdx +++ b/docs/platforms/javascript/common/performance/instrumentation/opentelemetry.mdx @@ -58,7 +58,6 @@ const Sentry = require("@sentry/node"); const { SentrySpanProcessor, SentryPropagator, - SentryContextManager, SentrySampler, } = require("@sentry/opentelemetry"); @@ -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