File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/nextjs/src/server Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -106,9 +106,12 @@ export function init(options: NodeOptions): NodeClient | undefined {
106106 } ) ,
107107 ) ;
108108
109- // Turn off Next.js' own fetch instrumentation
109+ // Turn off Next.js' own fetch instrumentation (only when we manage OTEL)
110110 // https://github.com/lforst/nextjs-fork/blob/1994fd186defda77ad971c36dc3163db263c993f/packages/next/src/server/lib/patch-fetch.ts#L245
111- process . env . NEXT_OTEL_FETCH_DISABLED = '1' ;
111+ // Enable with custom OTel setup: https://github.com/getsentry/sentry-javascript/issues/17581
112+ if ( ! options . skipOpenTelemetrySetup ) {
113+ process . env . NEXT_OTEL_FETCH_DISABLED = '1' ;
114+ }
112115
113116 // This value is injected at build time, based on the output directory specified in the build config. Though a default
114117 // is set there, we set it here as well, just in case something has gone wrong with the injection.
You can’t perform that action at this time.
0 commit comments