File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
packages/node/src/integrations Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ export { ContextLines } from './contextlines';
88export { Context } from './context' ;
99export { RequestData } from './requestdata' ;
1010export { LocalVariables } from './localvariables' ;
11+ export { Undici } from './undici' ;
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export class Undici implements Integration {
6363
6464 private readonly _options : UndiciOptions ;
6565
66- public constructor ( _options : UndiciOptions ) {
66+ public constructor ( _options : Partial < UndiciOptions > = { } ) {
6767 this . _options = {
6868 ...DEFAULT_UNDICI_OPTIONS ,
6969 ..._options ,
@@ -114,13 +114,19 @@ export class Undici implements Integration {
114114 : true ;
115115
116116 if ( shouldCreateSpan ) {
117+ const data : Record < string , unknown > = { } ;
118+ const params = url . searchParams . toString ( ) ;
119+ if ( params ) {
120+ data [ 'http.query' ] = `?${ params } ` ;
121+ }
122+ if ( url . hash ) {
123+ data [ 'http.fragment' ] = url . hash ;
124+ }
125+
117126 const span = activeSpan . startChild ( {
118127 op : 'http.client' ,
119128 description : `${ request . method || 'GET' } ${ stripUrlQueryAndFragment ( stringUrl ) } ` ,
120- data : {
121- 'http.query' : `?${ url . searchParams . toString ( ) } ` ,
122- 'http.fragment' : url . hash ,
123- } ,
129+ data,
124130 } ) ;
125131 request . __sentry__ = span ;
126132
You can’t perform that action at this time.
0 commit comments