nodejs / nodejs/node

diagnostics_channel: add a channel for filesystem operations

Aperta
#65,330 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature request
Lingua principale
JavaScript
Stelle
122k
Fork
37.3k
Merge medio
4g 2h
PR unite (30g)
283

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dalle API pubbliche node:fs e node:fs/promises e dalle convenzioni esistenti di TracingChannel di node:diagnostics_channel; confronta i percorsi sincrono, callback, promise, stream e filehandle. Definisci il livello di pubblicazione e i nomi dei canali, mantenendo il payload indipendente dai dettagli di FSReqCallback. Il lavoro è completo quando le operazioni pubbliche del filesystem supportate pubblicano gli eventi del ciclo di vita e i metadati documentati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, node.js
Ambito
api, operating-systems
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.