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
6666 if ( getActiveSpan ( ) ) {
6767 return instrumentRequest ( ctx , next , handlerOptions ) ;
6868 }
69- return withIsolationScope ( ( ) => {
70- return instrumentRequest ( ctx , next , handlerOptions ) ;
69+ return withIsolationScope ( isolationScope => {
70+ return instrumentRequest ( ctx , next , handlerOptions , isolationScope ) ;
7171 } ) ;
7272 } ;
7373} ;
@@ -76,6 +76,7 @@ async function instrumentRequest(
7676 ctx : Parameters < MiddlewareResponseHandler > [ 0 ] ,
7777 next : Parameters < MiddlewareResponseHandler > [ 1 ] ,
7878 options : MiddlewareOptions ,
79+ isolationScope ?: Scope ,
7980) : Promise < Response > {
8081 // Make sure we don't accidentally double wrap (e.g. user added middleware and integration auto added it)
8182 const locals = ctx . locals as AstroLocalsWithSentry ;
@@ -121,6 +122,8 @@ async function instrumentRequest(
121122 attributes [ 'http.fragment' ] = ctx . url . hash ;
122123 }
123124
125+ isolationScope ?. setTransactionName ( `${ method } ${ interpolatedRoute || ctx . url . pathname } ` ) ;
126+
124127 const res = await startSpan (
125128 {
126129 attributes,
You can’t perform that action at this time.
0 commit comments