From 070a35a2717e75951ff30efd53e8e8c56e8d2831 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Tue, 12 Nov 2024 13:18:34 +0100 Subject: [PATCH] Added workaround for Sentry disabling OTel - for some reason, Sentry is disabling OTel unless you enable tracing in Sentry, I don't know why - to workaround that, we can enable tracing but disable all the integrations --- src/instrumentation.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/instrumentation.ts b/src/instrumentation.ts index bc3f78f3..e4a38675 100644 --- a/src/instrumentation.ts +++ b/src/instrumentation.ts @@ -14,6 +14,11 @@ if (process.env.SENTRY_DSN) { dsn: process.env.SENTRY_DSN, environment: process.env.NODE_ENV || 'unknown', release: process.env.K_REVISION, + + // Enabled sampling but disable default integrations + // Without this, OTel won't work, and I'm not sure why + defaultIntegrations: false, + tracesSampleRate: 1.0, }); }