From b948aed945b7c6c89575d47c691325da0858ea68 Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Tue, 7 Mar 2023 10:13:20 +0100 Subject: [PATCH] fix(tracing): initialize server side tracing correctly --- lib/core/hooks.js | 2 ++ lib/core/options.js | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/core/hooks.js b/lib/core/hooks.js index 921d7a72..eeaeeb9a 100644 --- a/lib/core/hooks.js +++ b/lib/core/hooks.js @@ -169,6 +169,8 @@ export async function initializeServerSentry (moduleContainer, moduleOptions, se sentryHandlerProxy.errorHandler = Sentry.Handlers.errorHandler() sentryHandlerProxy.requestHandler = Sentry.Handlers.requestHandler(moduleOptions.requestHandlerConfig) if (serverOptions.tracing) { + // Triggers initialization of the tracing integration as a side effect. + await import('@sentry/tracing') sentryHandlerProxy.tracingHandler = Sentry.Handlers.tracingHandler() } } diff --git a/lib/core/options.js b/lib/core/options.js index a60a1d07..39b5903d 100644 --- a/lib/core/options.js +++ b/lib/core/options.js @@ -258,6 +258,7 @@ export async function resolveServerOptions (moduleContainer, moduleOptions, logg apiMethods, lazy: options.lazy, logMockCalls: options.logMockCalls, // for mocked only + tracing: options.tracing, } }