File tree 1 file changed +5
-3
lines changed
packages/node/src/integrations
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { getCurrentHub } from '@sentry/core' ;
2
- import { Integration , Span } from '@sentry/types' ;
2
+ import { Integration , Span , Transaction } from '@sentry/types' ;
3
3
import { fill , parseSemver } from '@sentry/utils' ;
4
4
import * as http from 'http' ;
5
5
import * as https from 'https' ;
@@ -79,15 +79,17 @@ function createHandlerWrapper(
79
79
}
80
80
81
81
let span : Span | undefined ;
82
+ let transaction : Transaction | undefined ;
82
83
83
84
const scope = getCurrentHub ( ) . getScope ( ) ;
84
85
if ( scope && tracingEnabled ) {
85
- scope . getTransaction ( transaction => {
86
+ transaction = scope . getTransaction ( ) ;
87
+ if ( transaction ) {
86
88
span = transaction . startChild ( {
87
89
description : `${ typeof options === 'string' || ! options . method ? 'GET' : options . method } ${ requestUrl } ` ,
88
90
op : 'request' ,
89
91
} ) ;
90
- } ) ;
92
+ }
91
93
}
92
94
93
95
return originalHandler
You can’t perform that action at this time.
0 commit comments