Skip to content

Commit e04cd55

Browse files
committed
fixup! feat(http): portable node:http client instrumentation (#20393)
1 parent 640f8f0 commit e04cd55

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/node-core/src/integrations/http/SentryHttpInstrumentation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { getHttpClientSubscriptions, patchHttpModuleClient, patchHttpsModuleClie
1515
import { INSTRUMENTATION_NAME } from './constants';
1616
import { HTTP_ON_CLIENT_REQUEST } from '@sentry/core';
1717
import { NODE_VERSION } from '../../nodeVersion';
18+
import { errorMonitor } from 'node:events';
1819

1920
const FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL =
2021
(NODE_VERSION.major === 22 && NODE_VERSION.minor >= 12) ||
@@ -200,6 +201,7 @@ export class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpIns
200201
options.outgoingResponseHook?.(span, response);
201202
context.bind(context.active(), response);
202203
},
204+
errorMonitor,
203205
};
204206

205207
const { [HTTP_ON_CLIENT_REQUEST]: onHttpClientRequestCreated } = getHttpClientSubscriptions(patchOptions);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import type { IncomingMessage, Server } from 'node:http';
1717
import { DEBUG_BUILD } from '../../debug-build';
1818
import { patchRequestToCaptureBody } from '../../utils/captureRequestBody';
1919
import type { LightNodeClient } from '../client';
20+
import { errorMonitor } from 'node:events';
2021

2122
const INTEGRATION_NAME = 'Http';
2223

@@ -101,6 +102,7 @@ const _httpIntegration = ((options: HttpIntegrationOptions = {}) => {
101102
ignoreOutgoingRequests: _options.ignoreOutgoingRequests,
102103
// No spans in light mode
103104
spans: false,
105+
errorMonitor,
104106
});
105107

106108
subscribe('http.server.request.start', onHttpServerRequestStart);

0 commit comments

Comments
 (0)