nodejs / nodejs/node

Consider updating diagnostic channel event names for bundled modules

Open
#61,149 11 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

diagnostics_channel question
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Slack discussion and the diagnostic_channel and Undici event references in the issue. Determine a naming scheme that distinguishes bundled from standalone modules, including the Node.js v20 constraint, and define the expected event names and compatibility behavior before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.