@accordkit/tracer - v0.2.1
    Preparing search index...

    Class FileSink

    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:

    1. immediate: Synchronously appends each event to its corresponding file. This is simple and durable.
    2. 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.

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • 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.

      Parameters

      Returns Promise<void> | undefined

    • 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.

      Returns Promise<void>

    • Cleans up resources used by the sink.

      This method stops the periodic flushing timer and performs a final flush of any remaining events.

      Returns Promise<void>