Skip to content

Commit

Permalink
fix: context loss in Node.js 12.0-12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Qard committed Sep 9, 2019
1 parent 866836c commit 462ff75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/instrumentation/http-shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ exports.traceOutgoingRequest = function (agent, moduleName, method) {
// is added instead of when `response` is emitted.
const emit = req.emit
req.emit = function (type, res) {
ins._recoverTransaction(span.transaction)
if (type === 'response') onresponse(res)
return emit.apply(req, arguments)
}
Expand Down

0 comments on commit 462ff75

Please sign in to comment.