File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import { flushQueue } from './utils/responseEnd';
2020import { withIsolationScopeOrReuseFromRootSpan } from './utils/withIsolationScopeOrReuseFromRootSpan' ;
2121
2222/** As our own HTTP integration is disabled (src/server/index.ts) the rootSpan comes from Next.js.
23- * In case there is not root span, we start a new span. */
23+ * In case there is no root span, we start a new span. */
2424function startOrUpdateSpan ( spanName : string , cb : ( rootSpan : Span ) => Promise < Response > ) : Promise < Response > {
2525 const activeSpan = getActiveSpan ( ) ;
2626 const rootSpan = activeSpan && getRootSpan ( activeSpan ) ;
Original file line number Diff line number Diff line change 44 getCapturedScopesOnSpan ,
55 getCurrentScope ,
66 getIsolationScope ,
7+ getRootSpan ,
78 setCapturedScopesOnSpan ,
89 spanToJSON ,
910} from '@sentry/core' ;
@@ -25,7 +26,7 @@ export const requestIsolationScopeIntegration = defineIntegration(() => {
2526 const data = spanJson . data || { } ;
2627
2728 // The following check is a heuristic to determine whether the started span is a span that tracks an incoming HTTP request
28- if ( ( getSpanKind ( span ) === SpanKind . SERVER && data [ 'http.method' ] ) || data [ 'next.route' ] ) {
29+ if ( ( getSpanKind ( span ) === SpanKind . SERVER && data [ 'http.method' ] ) || ( span === getRootSpan ( span ) && data [ 'next.route' ] ) ) {
2930 const scopes = getCapturedScopesOnSpan ( span ) ;
3031
3132 // Update the isolation scope, isolate this request
You can’t perform that action at this time.
0 commit comments