Tips on async tracing #4619
Unanswered
jeremy-rifkin
asked this question in
Q&A
Replies: 0 comments 1 reply
-
Hi! You can try using Node.js’s async_hooks module to trace your async functions without manually adding code everywhere. quick setup:
This will log each async operation’s start, before, after, and completion events. It’s a minimal setup that should help you see what’s running and when. Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m trying to debug an issue with a long-running application doing a lot of
async
processing. The issue specifically is that a certain async function is taking much longer than I expect to complete but only rarely. What I would like is a way to record a trace of what async code is running and when. For some code likeI’d basically like to see when the part before bar() is executed, when bar is called, and when the part after is executed.
Is there any way to do this without manually instrumenting the code?
I have explored some ideas using async_hooks but it seems I can’t quite get the information I want.
Beta Was this translation helpful? Give feedback.
All reactions