Creates an instance of FileSink.
Configuration options for the sink.
Writes a tracer event to a file.
In immediate mode, the event is synchronously appended to the session's log file.
In buffered mode, the event is added to an in-memory buffer for the session.
Flushes all buffered events for all sessions to their respective files.
This method is a no-op if the delivery mode is immediate.
In buffered mode, it forces a write of any pending events in memory.
Cleans up resources used by the sink.
This method stops the periodic flushing timer and performs a final flush of any remaining events.
A sink for Node.js environments that persists tracer events to the local file system. Events are stored in JSON Lines (
.jsonl) format, with a separate file for each session ID.It supports two delivery modes:
immediate: Synchronously appends each event to its corresponding file. This is simple and durable.buffered: Collects events in memory and writes them to files in batches. This offers higher throughput and is recommended for high-volume tracing. Flushing occurs when a batch is full, on a timer, or manually.