File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/node/src/integrations Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import { getCurrentHub } from '@sentry/core' ;
2- import { Integration , Span } from '@sentry/types' ;
2+ import { Integration , Span , Transaction } from '@sentry/types' ;
33import { fill , parseSemver } from '@sentry/utils' ;
44import * as http from 'http' ;
55import * as https from 'https' ;
@@ -79,15 +79,17 @@ function createHandlerWrapper(
7979 }
8080
8181 let span : Span | undefined ;
82+ let transaction : Transaction | undefined ;
8283
8384 const scope = getCurrentHub ( ) . getScope ( ) ;
8485 if ( scope && tracingEnabled ) {
85- scope . getTransaction ( transaction => {
86+ transaction = scope . getTransaction ( ) ;
87+ if ( transaction ) {
8688 span = transaction . startChild ( {
8789 description : `${ typeof options === 'string' || ! options . method ? 'GET' : options . method } ${ requestUrl } ` ,
8890 op : 'request' ,
8991 } ) ;
90- } ) ;
92+ }
9193 }
9294
9395 return originalHandler
You can’t perform that action at this time.
0 commit comments