evalution
    Preparing search index...

    Interface TraceSink

    The write side of a TraceProvider. A TraceIngestor feeds normalized spans in; the sink owns root detection, trace creation, and event emission.

    interface TraceSink {
        failTrace(traceId: string, errorMessage: string): Promise<void>;
        recordSpanEnd(span: Span): Promise<Span>;
        recordSpanStart(span: Span): Promise<Span>;
    }

    Implemented by

    Index

    Methods

    • Finalizes a trace as error when execution fails before any span is produced (e.g. a bad model id throws before onStart).

      Parameters

      • traceId: string
      • errorMessage: string

      Returns Promise<void>

    • Records a span end. For a root span, finalizes the trace and emits trace-end (+ watch update). Returns the stored (merged) span.

      Parameters

      Returns Promise<Span>

    • Records a span start. Creates a running trace for a new root. Returns the stored (merged) span. Emits span-start (+ watch add for a new trace).

      Parameters

      Returns Promise<Span>