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 {
7
7
defineIntegration ,
8
8
getActiveSpan ,
9
9
getCurrentScope ,
10
+ getDefaultIsolationScope ,
11
+ getIsolationScope ,
10
12
getRootSpan ,
11
13
} from '@sentry/core' ;
12
14
import type { IntegrationFn } from '@sentry/types' ;
15
+ import { logger } from '@sentry/utils' ;
16
+ import { DEBUG_BUILD } from '../../../debug-build' ;
13
17
import type { Boom , RequestEvent , ResponseObject , Server } from './types' ;
14
18
15
19
const _hapiIntegration = ( ( ) => {
@@ -59,9 +63,14 @@ export const hapiErrorPlugin = {
59
63
const server = serverArg as unknown as Server ;
60
64
61
65
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' ) ;
65
74
}
66
75
67
76
const activeSpan = getActiveSpan ( ) ;
You can’t perform that action at this time.
0 commit comments