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';
20
20
import { withIsolationScopeOrReuseFromRootSpan } from './utils/withIsolationScopeOrReuseFromRootSpan' ;
21
21
22
22
/** 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. */
24
24
function startOrUpdateSpan ( spanName : string , cb : ( rootSpan : Span ) => Promise < Response > ) : Promise < Response > {
25
25
const activeSpan = getActiveSpan ( ) ;
26
26
const rootSpan = activeSpan && getRootSpan ( activeSpan ) ;
Original file line number Diff line number Diff line change 4
4
getCapturedScopesOnSpan ,
5
5
getCurrentScope ,
6
6
getIsolationScope ,
7
+ getRootSpan ,
7
8
setCapturedScopesOnSpan ,
8
9
spanToJSON ,
9
10
} from '@sentry/core' ;
@@ -25,7 +26,7 @@ export const requestIsolationScopeIntegration = defineIntegration(() => {
25
26
const data = spanJson . data || { } ;
26
27
27
28
// 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' ] ) ) {
29
30
const scopes = getCapturedScopesOnSpan ( span ) ;
30
31
31
32
// Update the isolation scope, isolate this request
You can’t perform that action at this time.
0 commit comments