Async Aware Stack Traces via v8 C++ API

15 views
Skip to first unread message

Matthew Nicholson

unread,
Sep 19, 2025, 3:26:33 PM (9 days ago) Sep 19
to v8-dev
Hi,

I'm trying to use Sentry's event loop block detection[0] and encountering an issue with stack traces for async code. Internally, Sentry uses StackTrace::CurrentStackTrace[1] to retrieve stack traces, but this doesn't follow the stack across async bounds and only reports the trace for the currently running promise up to node's task runner. Further investigate revealed that StackTrace::CurrentStackTrace is implemented using Isolate::CaptureDetailedStackTrace, which has no handling for async stuff. That's in contrast with Isolate::CaptureSimpleStackTrace which does have special handling for async control flow. This can be observed in the async-aware stack traces when an exception is thrown. 

I wasn't able to find a way to access an async-aware stack trace this via v8's external API surface. Am I missing something or is this functionality not supported?

Reply all
Reply to author
Forward
0 new messages