java.lang.Object
codes.grow.packages.otelcollector.tracing.query.Traces

public final class Traces extends Object
Span ordering and tree helpers.
  • Method Details

    • sortSpans

      public static List<Span> sortSpans(List<Span> spans)
      Sorts spans by startMicros, then spanId.
      Parameters:
      spans - spans
      Returns:
      new immutable sorted list
    • buildTree

      public static List<SpanNode> buildTree(List<Span> spans)
      Builds the span tree. Spans without a parent, or whose parent is not in the list, are roots. Cycles are broken by treating the first span of a cycle as a root.
      Parameters:
      spans - spans of one trace
      Returns:
      root nodes in span order
    • summarize

      public static TraceSummary summarize(Trace trace)
      Summarises a trace.
      Parameters:
      trace - trace
      Returns:
      summary (root service and name from the first root span)