Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Move end of http request span to correct location. (#131)
Browse files Browse the repository at this point in the history
Co-authored-by: zhangsihao <[email protected]>
  • Loading branch information
jasper-zsh and zhangsihao authored Sep 24, 2020
1 parent 3b13028 commit c0e3fa0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/nodejs-agent/lib/plugins/http/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ module.exports = function(httpModule, instrumentation, contextManager) {
span.component(componentDefine.Components.HTTP);
span.spanLayer(layerDefine.Layers.HTTP);
let result = original.apply(this, arguments);
contextManager.finishSpan(span);
result.once("response", function(res) {
res.once("end", function() {
contextManager.finishSpan(span);
});
});
return result;
};
}
Expand Down

0 comments on commit c0e3fa0

Please sign in to comment.