Skip to content

fs: add built-in fs.operation diagnostics channels - #65370

Draft
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:fs-diagnostics-channel
Draft

fs: add built-in fs.operation diagnostics channels#65370
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:fs-diagnostics-channel

Conversation

@mcollina

Copy link
Copy Markdown
Member

Adds a built-in node:diagnostics_channel channel family for file system operations performed through node:fs and node:fs/promises, addressing #65330.

The channels are tracing:fs.operation:start, :end, :asyncStart, :asyncEnd, and :error, and share an event payload carrying the operation name, the API (sync/callback/promise), path/dest/fd fields when applicable, plus result/error following TracingChannel conventions. Subscribers can use diagnostics_channel.tracingChannel('fs.operation') to subscribe to all events at once.

Events are published from the internal shared file system layer rather than the JS wrappers, so captured function references still emit events. Adds documentation and a new test/parallel/test-diagnostics-channel-fs.js.

Add a built-in node:diagnostics_channel channel family for file system
operations performed through node:fs and node:fs/promises. The channels
are named tracing:fs.operation:start, :end, :asyncStart, :asyncEnd, and
:error, and share an event payload carrying the operation name, the API
(sync/callback/promise), path/dest/fd fields when applicable, plus
result/error following TracingChannel conventions.

Events are published from the internal shared file system layer rather
than the JS wrappers, so captured function references still emit events.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants