Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Vunovati authored Nov 30, 2023
2 parents 1ae7641 + 593d220 commit 286280a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All notable changes to experimental packages in this project will be documented
* fix(sdk-logs): avoid map attribute set when count limit exceeded
* fix(instrumentation-fetch): only access navigator if it is defined [#4063](https://github.com/open-telemetry/opentelemetry-js/pull/4063)
* allows for experimental usage of this instrumentation with non-browser runtimes
* fix(instrumentation-http): memory leak when responses are not resumed

## 0.45.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
'response',
(response: http.IncomingMessage & { aborted?: boolean }) => {
this._diag.debug('outgoingRequest on response()');
if (request.listenerCount('response') <= 1) {
response.resume();
}
const responseAttributes =
utils.getOutgoingRequestAttributesOnResponse(response);
span.setAttributes(responseAttributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function sendRequestTwice(
port: number
): Promise<Buffer> {
return new Promise((resolve, reject) => {
const request = 'GET /raw HTTP/1.1\n\n';
const request = `GET /raw HTTP/1.1\r\nHost: ${host}:${port}\r\n\r\n`;
const socket = net.createConnection({ host, port }, () => {
socket.write(`${request}${request}`, err => {
if (err) reject(err);
Expand Down

0 comments on commit 286280a

Please sign in to comment.