Tips on async tracing #55608
Unanswered
jeremy-rifkin
asked this question in
General
Replies: 1 comment
-
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
-
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