Skip to content

Consider updating diagnostic channel event names for bundled modules #61149

@jsumners-nr

Description

@jsumners-nr

https://openjs-foundation.slack.com/archives/C01QF9Q31QD/p1766166962883319

I'd like to propose that when Node.js bundles an external module that generates diagnostic_channel events, that those event names are differentiated from the upstream names. Consider undici, it generates events such as undici:request:pending-requests (https://undici.nodejs.org/#/docs/api/DiagnosticsChannel?id=undicirequestpending-requests). These events are emitted as-is from the Node.js bundled version of Undici, thus making it impossible to determine if the event was generated from the standalone module or the bundled module.

In day-to-day usage, this is not technically a problem. I am sure we can think of other cases where it might be an issue, but my current problem is that I need to retrieve the module version for the module that generated the event. I cannot currently rely on registerHooks to solve this because v20 does not support it.

Regardless, I just think it would be better to differentiate between upstream and bundled in event emissions for clarity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions