File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/astro/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 @@ -66,8 +66,8 @@ export const handleRequest: (options?: MiddlewareOptions) => MiddlewareResponseH
66
66
if ( getActiveSpan ( ) ) {
67
67
return instrumentRequest ( ctx , next , handlerOptions ) ;
68
68
}
69
- return withIsolationScope ( ( ) => {
70
- return instrumentRequest ( ctx , next , handlerOptions ) ;
69
+ return withIsolationScope ( isolationScope => {
70
+ return instrumentRequest ( ctx , next , handlerOptions , isolationScope ) ;
71
71
} ) ;
72
72
} ;
73
73
} ;
@@ -76,6 +76,7 @@ async function instrumentRequest(
76
76
ctx : Parameters < MiddlewareResponseHandler > [ 0 ] ,
77
77
next : Parameters < MiddlewareResponseHandler > [ 1 ] ,
78
78
options : MiddlewareOptions ,
79
+ isolationScope ?: Scope ,
79
80
) : Promise < Response > {
80
81
// Make sure we don't accidentally double wrap (e.g. user added middleware and integration auto added it)
81
82
const locals = ctx . locals as AstroLocalsWithSentry ;
@@ -121,6 +122,8 @@ async function instrumentRequest(
121
122
attributes [ 'http.fragment' ] = ctx . url . hash ;
122
123
}
123
124
125
+ isolationScope ?. setTransactionName ( `${ method } ${ interpolatedRoute || ctx . url . pathname } ` ) ;
126
+
124
127
const res = await startSpan (
125
128
{
126
129
attributes,
You can’t perform that action at this time.
0 commit comments