22  SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN , 
33  SEMANTIC_ATTRIBUTE_SENTRY_SOURCE , 
44  getActiveSpan , 
5+   getDefaultIsolationScope , 
6+   getIsolationScope , 
57  getRootSpan , 
68  setHttpStatus , 
79  spanToTraceHeader , 
@@ -10,11 +12,12 @@ import {
1012import  {  startSpan  }  from  '@sentry/core' ; 
1113import  {  captureException ,  continueTrace  }  from  '@sentry/node' ; 
1214import  type  {  Span  }  from  '@sentry/types' ; 
13- import  {  dynamicSamplingContextToSentryBaggageHeader ,  objectify  }  from  '@sentry/utils' ; 
15+ import  {  dynamicSamplingContextToSentryBaggageHeader ,  logger ,   objectify  }  from  '@sentry/utils' ; 
1416import  type  {  Handle ,  ResolveOptions  }  from  '@sveltejs/kit' ; 
1517
1618import  {  getDynamicSamplingContextFromSpan  }  from  '@sentry/opentelemetry' ; 
1719
20+ import  {  DEBUG_BUILD  }  from  '../common/debug-build' ; 
1821import  {  isHttpError ,  isRedirect  }  from  '../common/utils' ; 
1922import  {  flushIfServerless ,  getTracePropagationData  }  from  './utils' ; 
2023
@@ -184,6 +187,14 @@ async function instrumentHandle(
184187  } 
185188
186189  try  { 
190+     const  routeName  =  `${ event . request . method } ${ event . route ?. id  ||  event . url . pathname }  ; 
191+ 
192+     if  ( getIsolationScope ( )  !==  getDefaultIsolationScope ( ) )  { 
193+       getIsolationScope ( ) . setTransactionName ( routeName ) ; 
194+     }  else  { 
195+       DEBUG_BUILD  &&  logger . warn ( 'Isolation scope is default isolation scope - skipping setting transactionName' ) ; 
196+     } 
197+ 
187198    const  resolveResult  =  await  startSpan ( 
188199      { 
189200        op : 'http.server' , 
@@ -192,7 +203,7 @@ async function instrumentHandle(
192203          [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : event . route ?. id  ? 'route'  : 'url' , 
193204          'http.method' : event . request . method , 
194205        } , 
195-         name : ` ${ event . request . method }   ${ event . route ?. id   ||   event . url . pathname } ` , 
206+         name : routeName , 
196207      } , 
197208      async  ( span ?: Span )  =>  { 
198209        const  res  =  await  resolve ( event ,  { 
0 commit comments