Skip to content

Commit

Permalink
Merge 915da21 into feea516
Browse files Browse the repository at this point in the history
  • Loading branch information
Asafb26 committed Sep 9, 2021
2 parents feea516 + 915da21 commit 3ed4e23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/opentelemetry-instrumentation-http/src/http.ts
Expand Up @@ -326,17 +326,20 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
this._closeHttpSpan(span);
});
response.on('error', (error: Err) => {
this._diag.debug('outgoingRequest on error()', error);
utils.setSpanWithError(span, error, response);
this._closeHttpSpan(span);
});
}
);
request.on('close', () => {
this._diag.debug('outgoingRequest on request close()');
if (!request.aborted) {
this._closeHttpSpan(span);
}
});
request.on('error', (error: Err) => {
this._diag.debug('outgoingRequest on request error()', error);
utils.setSpanWithError(span, error, request);
this._closeHttpSpan(span);
});
Expand Down

0 comments on commit 3ed4e23

Please sign in to comment.