File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
packages/node/src/integrations/tracing/hapi Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,13 @@ import {
77 defineIntegration ,
88 getActiveSpan ,
99 getCurrentScope ,
10+ getDefaultIsolationScope ,
11+ getIsolationScope ,
1012 getRootSpan ,
1113} from '@sentry/core' ;
1214import type { IntegrationFn } from '@sentry/types' ;
15+ import { logger } from '@sentry/utils' ;
16+ import { DEBUG_BUILD } from '../../../debug-build' ;
1317import type { Boom , RequestEvent , ResponseObject , Server } from './types' ;
1418
1519const _hapiIntegration = ( ( ) => {
@@ -59,9 +63,14 @@ export const hapiErrorPlugin = {
5963 const server = serverArg as unknown as Server ;
6064
6165 server . events . on ( 'request' , ( request , event ) => {
62- const route = request . route ;
63- if ( route && route . path ) {
64- getCurrentScope ( ) . setTransactionName ( `${ route . method ?. toUpperCase ( ) || 'GET' } ${ route . path } ` ) ;
66+ if ( getIsolationScope ( ) !== getDefaultIsolationScope ( ) ) {
67+ const route = request . route ;
68+ if ( route && route . path ) {
69+ getIsolationScope ( ) . setTransactionName ( `${ route . method ?. toUpperCase ( ) || 'GET' } ${ route . path } ` ) ;
70+ }
71+ } else {
72+ DEBUG_BUILD &&
73+ logger . warn ( 'Isolation scope is still the default isolation scope - skipping setting transactionName' ) ;
6574 }
6675
6776 const activeSpan = getActiveSpan ( ) ;
You can’t perform that action at this time.
0 commit comments