log2trace-ui - v1.0.0-rc.9
    Preparing search index...

    Function buildSpanIndex

    • Build an immutable span index from OTel TraceData.

      Performs a single pass to collect spans, resolve parent-child links, order them depth-first by start time, and compute the bounding time range. The result is a frozen data structure suitable for repeated read access.

      A span id that occurs twice keeps the later span. A span whose parent is not in the data is a root, and so is the earliest member of a parent cycle.

      Parameters

      • traceData: TraceData

        OTel-shaped trace data from transformLogs or a backend.

      Returns SpanIndex

      A new SpanIndex. Safe to call repeatedly on the same input.

      Error when a span or event time is not a nanosecond timestamp.