File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
packages/node/src/integrations Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,11 @@ const _nativeNodeFetchIntegration = ((options: NodeFetchOptions = {}) => {
44
44
const url = request . origin ;
45
45
return _ignoreOutgoingRequests && url && _ignoreOutgoingRequests ( url ) ;
46
46
} ,
47
- onRequest : ( { span } : { span : Span } ) => {
47
+ onRequest : ( { span, request } : { span : Span ; request : unknown } ) => {
48
48
_updateSpan ( span ) ;
49
49
50
50
if ( _breadcrumbs ) {
51
- _addRequestBreadcrumb ( span ) ;
51
+ _addRequestBreadcrumb ( span , request ) ;
52
52
}
53
53
} ,
54
54
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -80,17 +80,23 @@ function _updateSpan(span: Span): void {
80
80
}
81
81
82
82
/** Add a breadcrumb for outgoing requests. */
83
- function _addRequestBreadcrumb ( span : Span ) : void {
83
+ function _addRequestBreadcrumb ( span : Span , request : unknown ) : void {
84
84
if ( getSpanKind ( span ) !== SpanKind . CLIENT ) {
85
85
return ;
86
86
}
87
87
88
88
const data = getRequestSpanData ( span ) ;
89
- addBreadcrumb ( {
90
- category : 'http' ,
91
- data : {
92
- ...data ,
89
+ addBreadcrumb (
90
+ {
91
+ category : 'http' ,
92
+ data : {
93
+ ...data ,
94
+ } ,
95
+ type : 'http' ,
93
96
} ,
94
- type : 'http' ,
95
- } ) ;
97
+ {
98
+ event : 'response' ,
99
+ request,
100
+ } ,
101
+ ) ;
96
102
}
You can’t perform that action at this time.
0 commit comments