diagnostics_channel: add a channel for filesystem operations
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
What is the problem this feature will solve?
node:diagnostics_channel does not currently expose a built-in channel for filesystem operations performed through node:fs and node:fs/promises.
The proposed scope is the public filesystem APIs. Calls made directly by native addons or arbitrary native code do not need to be included in this contract.
What is the feature you are proposing to solve the problem?
Add a built-in tracing channel family for filesystem operations. One possible naming scheme is:
tracing:fs.operation:starttracing:fs.operation:endtracing:fs.operation:asyncStarttracing:fs.operation:asyncEndtracing:fs.operation:error
The shared event object could contain:
operation: a stable operation name such asopen,read,stat,readdir, orrealpath.api:sync,callback,promise,stream, orfilehandle.- Path, source/destination, or file descriptor fields when applicable, preserving the value type passed by the caller.
resultanderrorfollowing the existingTracingChannelconventions.
Large read/write buffers should not be copied into event metadata. The exact publication layer—public API wrappers or the lowest shared internal filesystem layer—can be determined during implementation, but the documented payload should remain independent of internal FSReqCallback details.
Using one operation family with an operation field avoids requiring wildcard channel subscriptions while allowing subscribers to filter individual operations.
What alternatives have you considered?
Wrapping exports from node:fs and node:fs/promises is incomplete when references have already been captured and requires synchronization with named built-in ESM exports. async_hooks exposes asynchronous resource lifecycles rather than stable filesystem operation semantics and does not cover synchronous calls. Trace events use a different consumption API and payload contract.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the public node:fs and node:fs/promises APIs and the existing node:diagnostics_channel TracingChannel conventions; compare sync, callback, promise, stream, and filehandle paths. Resolve the publication layer and channel names while keeping the payload independent of FSReqCallback details. Done means supported public filesystem operations publish the documented lifecycle events and metadata.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100