Record Class DistributedTracer.Span
java.lang.Object
java.lang.Record
com.loomcache.server.observability.DistributedTracer.Span
- Record Components:
traceId- W3C-compatible 128-bit trace ID (32 hex chars)spanId- W3C-compatible 64-bit span ID (16 hex chars)parentSpanId- parent span ID (null for root spans)operationName- human-readable operation namestartTimeNs- start time in nanosecondsendTimeNs- end time in nanosecondsstatus- final span statusattributes- immutable span attributesevents- immutable list of span events
- Enclosing class:
DistributedTracer
public static record DistributedTracer.Span(String traceId, String spanId, @Nullable String parentSpanId, String operationName, long startTimeNs, long endTimeNs, DistributedTracer.SpanStatus status, Map<String,String> attributes, List<DistributedTracer.TimestampedEvent> events)
extends Record
Immutable span data structure.
Contains all information about a completed span for export and analysis.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.longGet the duration of this span in nanoseconds.longReturns the value of theendTimeNsrecord component.final booleanIndicates whether some other object is "equal to" this one.events()Returns the value of theeventsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theoperationNamerecord component.@Nullable StringReturns the value of theparentSpanIdrecord component.spanId()Returns the value of thespanIdrecord component.longReturns the value of thestartTimeNsrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.traceId()Returns the value of thetraceIdrecord component.
-
Constructor Details
-
Span
public Span(String traceId, String spanId, @Nullable String parentSpanId, String operationName, long startTimeNs, long endTimeNs, DistributedTracer.SpanStatus status, Map<String, String> attributes, List<DistributedTracer.TimestampedEvent> events) Create a Span with all fields.
-
-
Method Details
-
durationNs
public long durationNs()Get the duration of this span in nanoseconds.- Returns:
- duration in nanoseconds
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
traceId
-
spanId
-
parentSpanId
Returns the value of theparentSpanIdrecord component.- Returns:
- the value of the
parentSpanIdrecord component
-
operationName
Returns the value of theoperationNamerecord component.- Returns:
- the value of the
operationNamerecord component
-
startTimeNs
public long startTimeNs()Returns the value of thestartTimeNsrecord component.- Returns:
- the value of the
startTimeNsrecord component
-
endTimeNs
-
status
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
events
-