Skip to content

Commit 499871a

Browse files
Qardwatson
authored andcommitted
fix(http): response context propagation on Node.js 12.0 - 12.2 (#1339)
1 parent 89ad54a commit 499871a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/instrumentation/http-shared.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ exports.traceOutgoingRequest = function (agent, moduleName, method) {
156156
return req
157157

158158
function onresponse (res) {
159+
// Work around async_hooks bug in Node.js 12.0 - 12.2 (https://github.com/nodejs/node/pull/27477)
160+
ins._recoverTransaction(span.transaction)
161+
159162
agent.logger.debug('intercepted http.ClientRequest response event %o', { id: id })
160163
ins.bindEmitter(res)
161164

0 commit comments

Comments
 (0)