Skip to content

Commit eb95b27

Browse files
committed
fixup! fixup! fixup! feat(http): portable node:http client instrumentation (#20393)
1 parent 5a488c6 commit eb95b27

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/node-core/src/light/integrations/httpIntegration.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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';
1717
import { DEBUG_BUILD } from '../../debug-build';
1818
import { patchRequestToCaptureBody } from '../../utils/captureRequestBody';
19+
import { getRequestOptions } from '../../utils/outgoingHttpRequest';
1920
import type { LightNodeClient } from '../client';
2021
import { 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

Comments
 (0)