Record Class SearchTrace

java.lang.Object
java.lang.Record
codes.grow.packages.tempo.SearchTrace
Record Components:
traceId - 32 lower-case hex characters (Tempo trims leading zeros; the SDK pads them back)
rootServiceName - service of the root span, if known
rootTraceName - name of the root span, if known
startMicros - trace start in microseconds since the Unix epoch
durationMicros - trace duration (Tempo reports whole milliseconds)
spanSets - matching spans
serviceStats - spans and errors per service

public record SearchTrace(String traceId, Optional<String> rootServiceName, Optional<String> rootTraceName, long startMicros, long durationMicros, List<SpanSet> spanSets, Map<String,ServiceStats> serviceStats) extends Record
  • Constructor Details

    • SearchTrace

      public SearchTrace(String traceId, Optional<String> rootServiceName, Optional<String> rootTraceName, long startMicros, long durationMicros, List<SpanSet> spanSets, Map<String,ServiceStats> serviceStats)
      Copies the collections.
      Parameters:
      traceId - trace id
      rootServiceName - root service
      rootTraceName - root name
      startMicros - start
      durationMicros - duration
      spanSets - span sets
      serviceStats - service stats
  • Method Details

    • spanCount

      public int spanCount()
      Total spans of the trace (sum of serviceStats span counts).
      Returns:
      span count
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • traceId

      public String traceId()
      Returns the value of the traceId record component.
      Returns:
      the value of the traceId record component
    • rootServiceName

      public Optional<String> rootServiceName()
      Returns the value of the rootServiceName record component.
      Returns:
      the value of the rootServiceName record component
    • rootTraceName

      public Optional<String> rootTraceName()
      Returns the value of the rootTraceName record component.
      Returns:
      the value of the rootTraceName record component
    • startMicros

      public long startMicros()
      Returns the value of the startMicros record component.
      Returns:
      the value of the startMicros record component
    • durationMicros

      public long durationMicros()
      Returns the value of the durationMicros record component.
      Returns:
      the value of the durationMicros record component
    • spanSets

      public List<SpanSet> spanSets()
      Returns the value of the spanSets record component.
      Returns:
      the value of the spanSets record component
    • serviceStats

      public Map<String,ServiceStats> serviceStats()
      Returns the value of the serviceStats record component.
      Returns:
      the value of the serviceStats record component