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

    Interface HttpSinkOptions

    interface HttpSinkOptions {
        endpoint: string;
        headers?: Record<string, string>;
        retry?: Partial<RetryPolicy>;
        onDropBatch?: (lines: string[], error: unknown) => void;
        idempotencyKey?: (lines: string[], attempt: number) => string;
        maxBuffer?: number;
        batchSize?: number;
        flushIntervalMs?: number;
        overflowPolicy?: OverflowPolicy;
    }

    Hierarchy (View Summary)

    Index

    Properties

    endpoint: string

    POST URL for ingestion (required).

    headers?: Record<string, string>

    Extra headers for POST (content-type defaults to application/json).

    retry?: Partial<RetryPolicy>

    Per-batch retry policy (defaults: retries=3, baseMs=300, maxMs=5000, jitter=true).

    onDropBatch?: (lines: string[], error: unknown) => void

    Called when a batch is dropped after retry exhaustion or non-retryable status.

    idempotencyKey?: (lines: string[], attempt: number) => string

    Optional idempotency key supplier. If provided, its return value will be set as the 'Idempotency-Key' header on each attempt for this batch. Signature: (lines, attempt) => key

    maxBuffer?: number

    The maximum total number of events to keep in memory across all session buffers. If the total exceeds this size, the oldest events from the largest buffer will be dropped. This prevents unbounded memory growth. Only applies to buffered delivery mode.

    5000
    
    batchSize?: number

    The number of events to collect in a session's buffer before triggering a flush. Only applies to buffered delivery mode.

    100
    
    flushIntervalMs?: number

    The maximum time in milliseconds to wait before flushing buffers, regardless of their size. Only applies to buffered delivery mode.

    1000
    
    overflowPolicy?: OverflowPolicy

    The policy to apply when the maxBuffer limit is reached. This determines how the sink behaves when it's under heavy load.

    • auto-flush: Immediately triggers a flush.
    • drop-oldest: Discards the oldest events to make room for new ones.
    • error: Throw on overflow (useful for tests).

    OverflowPolicy

    'auto-flush'