@@ -13,9 +13,10 @@ import {
1313 stripUrlQueryAndFragment ,
1414 withIsolationScope ,
1515} from '@sentry/core' ;
16- import type { IncomingMessage , Server } from 'node:http' ;
16+ import type { ClientRequest , IncomingMessage , Server } from 'node:http' ;
1717import { DEBUG_BUILD } from '../../debug-build' ;
1818import { patchRequestToCaptureBody } from '../../utils/captureRequestBody' ;
19+ import { getRequestOptions } from '../../utils/outgoingHttpRequest' ;
1920import type { LightNodeClient } from '../client' ;
2021import { errorMonitor } from 'node:events' ;
2122
@@ -96,10 +97,14 @@ const _httpIntegration = ((options: HttpIntegrationOptions = {}) => {
9697 instrumentServer ( data . server , _options ) ;
9798 } ;
9899
100+ const { ignoreOutgoingRequests } = _options ;
101+
99102 const { [ HTTP_ON_CLIENT_REQUEST ] : onHttpClientRequestCreated } = getHttpClientSubscriptions ( {
100103 breadcrumbs : _options . breadcrumbs ,
101104 propagateTrace : _options . tracePropagation ,
102- ignoreOutgoingRequests : _options . ignoreOutgoingRequests ,
105+ ignoreOutgoingRequests : ignoreOutgoingRequests
106+ ? ( url , request ) => ignoreOutgoingRequests ( url , getRequestOptions ( request as ClientRequest ) )
107+ : undefined ,
103108 // No spans in light mode
104109 spans : false ,
105110 errorMonitor,
0 commit comments