I have a web application with node + express. I want to record web request execution from start to end which include some db calls as well. How could I map the context of http request to db call context. I have tried async_hook APIs as well. Found that in case of db calls it uses the old connection instead of creating new connection. In this condition how can I map http request to db call? Thanks in advance.
-
can you clarify what you want to "record"? Are you trying to have your code add logging details to the request? I am also unclear on what you mean by "map the context" or even what you mean by context (which is often the "this" object in JS code). See if you can elaborate.DDupont– DDupont2019-07-19 18:05:44 +00:00Commented Jul 19, 2019 at 18:05
Add a comment
|
1 Answer
Try eizer Zipkin or this https://blog.risingstack.com/distributed-tracing-opentracing-node-js/
P.s. Db requests tracing - is painful task =)
1 Comment
x1n13y84issmd42
A link to a solution is welcome, but please ensure your answer is useful without it: add context around the link so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. Answers that are little more than a link may be deleted.