nodejs / nodejs/node

diagnostics_channel: add a channel for filesystem operations

Offen
#65,330 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature request
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

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:start
  • tracing:fs.operation:end
  • tracing:fs.operation:asyncStart
  • tracing:fs.operation:asyncEnd
  • tracing:fs.operation:error

The shared event object could contain:

  • operation: a stable operation name such as open, read, stat, readdir, or realpath.
  • api: sync, callback, promise, stream, or filehandle.
  • Path, source/destination, or file descriptor fields when applicable, preserving the value type passed by the caller.
  • result and error following the existing TracingChannel conventions.

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit den öffentlichen node:fs- und node:fs/promises-APIs sowie den bestehenden node:diagnostics_channel-TracingChannel-Konventionen; vergleiche synchrone, Callback-, Promise-, Stream- und Filehandle-Pfade. Kläre die Veröffentlichungsschicht und die Channel-Namen, während der Payload unabhängig von FSReqCallback-Details bleibt. Als abgeschlossen gilt die Arbeit, wenn unterstützte öffentliche Dateisystemoperationen die dokumentierten Lebenszyklusereignisse und Metadaten veröffentlichen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
api, operating-systems
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.