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';
8
8
export { Context } from './context' ;
9
9
export { RequestData } from './requestdata' ;
10
10
export { 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 {
63
63
64
64
private readonly _options : UndiciOptions ;
65
65
66
- public constructor ( _options : UndiciOptions ) {
66
+ public constructor ( _options : Partial < UndiciOptions > = { } ) {
67
67
this . _options = {
68
68
...DEFAULT_UNDICI_OPTIONS ,
69
69
..._options ,
@@ -114,13 +114,19 @@ export class Undici implements Integration {
114
114
: true ;
115
115
116
116
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
+
117
126
const span = activeSpan . startChild ( {
118
127
op : 'http.client' ,
119
128
description : `${ request . method || 'GET' } ${ stripUrlQueryAndFragment ( stringUrl ) } ` ,
120
- data : {
121
- 'http.query' : `?${ url . searchParams . toString ( ) } ` ,
122
- 'http.fragment' : url . hash ,
123
- } ,
129
+ data,
124
130
} ) ;
125
131
request . __sentry__ = span ;
126
132
You can’t perform that action at this time.
0 commit comments