Skip to content

Commit 0a52166

Browse files
authored
Merge branch 'main' into node-20-test
2 parents 1dda06a + cc4ff2d commit 0a52166

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

experimental/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All notable changes to experimental packages in this project will be documented
1313
* fix(sdk-logs): avoid map attribute set when count limit exceeded
1414
* fix(instrumentation-fetch): only access navigator if it is defined [#4063](https://github.com/open-telemetry/opentelemetry-js/pull/4063)
1515
* allows for experimental usage of this instrumentation with non-browser runtimes
16+
* fix(instrumentation-http): memory leak when responses are not resumed
1617

1718
## 0.45.1
1819

experimental/packages/opentelemetry-instrumentation-http/src/http.ts

+3
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
330330
'response',
331331
(response: http.IncomingMessage & { aborted?: boolean }) => {
332332
this._diag.debug('outgoingRequest on response()');
333+
if (request.listenerCount('response') <= 1) {
334+
response.resume();
335+
}
333336
const responseAttributes =
334337
utils.getOutgoingRequestAttributesOnResponse(response);
335338
span.setAttributes(responseAttributes);

0 commit comments

Comments
 (0)