Skip to content

Is it possible to keep track of the async_id / trigger_async_id chain solely from the C++ code? #5064

Open
@rafaelroquetto

Description

@rafaelroquetto

Node.js Version

v23.9.0

NPM Version

11.3.0

Operating System

Linux 6.14.5-arch1-

Subsystem

async_hooks

Description

I am an engineer working on Grafana Beyla, and a rookie to the NodeJS source.

To get to the point: is it possible to keep track of newly generated async_ids and their respective trigger_ids solely from the C++ layer, so that we can build an async resource graph (analogous to what's being described here)?

To elaborate a bit, I am able to get a few branches of the graph by instrumenting the likes of AsyncWrap::EmitAsyncInit()/AsyncWrap::AsyncReset(), but I noticed that not every new async id is coming from Environment::new_async_id().

Happy to dive deeper on what I've already attempted, but will try to keep it concise for now.

Thanks!

Minimal Reproduction

No response

Output

No response

Before You Submit

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions