Record Class Span
java.lang.Object
java.lang.Record
codes.grow.packages.datadogapm.tracing.query.Span
- Record Components:
traceId- 32 lower-hex characters (or a native id, seeTraceIds.traceId(java.lang.String))spanId- 16 lower-hex characters (or a native id, seeTraceIds.spanId(java.lang.String))parentSpanId- parent span id, if anyname- operation namekind- span kindserviceName-service.nameof the reporting servicestartMicros- start timeendMicros- end timedurationMicros- durationstatus- status code and messageattributes- attribute valuesevents- eventslinks- links
public record Span(String traceId, String spanId, Optional<String> parentSpanId, String name, Span.Kind kind, String serviceName, long startMicros, long endMicros, long durationMicros, Span.Status status, Map<String,Object> attributes, List<Span.Event> events, List<Span.Link> links)
extends Record
A span as returned by a
TraceQueryClient (normalized model; not the OpenTelemetry API
span). Times are microseconds since the Unix epoch.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final recordSpan event.static enumSpan kind (wire values are lower case).static final recordSpan link.static final recordSpan status.static enumStatus code (wire values are lower case). -
Constructor Summary
ConstructorsConstructorDescriptionSpan(String traceId, String spanId, Optional<String> parentSpanId, String name, Span.Kind kind, String serviceName, long startMicros, long endMicros, long durationMicros, Span.Status status, Map<String, Object> attributes, List<Span.Event> events, List<Span.Link> links) Normalises ids, copies collections and checks the times. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.static Span.BuilderReturns a builder.longReturns the value of thedurationMicrosrecord component.longReturns the value of theendMicrosrecord 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.booleanisRoot()Whether the span is a root (no parent).kind()Returns the value of thekindrecord component.links()Returns the value of thelinksrecord component.name()Returns the value of thenamerecord component.Returns the value of theparentSpanIdrecord component.Returns the value of theserviceNamerecord component.spanId()Returns the value of thespanIdrecord component.longReturns the value of thestartMicrosrecord 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, Optional<String> parentSpanId, String name, Span.Kind kind, String serviceName, long startMicros, long endMicros, long durationMicros, Span.Status status, Map<String, Object> attributes, List<Span.Event> events, List<Span.Link> links) Normalises ids, copies collections and checks the times.- Parameters:
traceId- trace idspanId- span idparentSpanId- parent span idname- namekind- kindserviceName- service namestartMicros- startendMicros- enddurationMicros- durationstatus- statusattributes- attributesevents- eventslinks- links
-
-
Method Details
-
builder
Returns a builder.- Parameters:
traceId- trace idspanId- span idname- name- Returns:
- builder
-
isRoot
public boolean isRoot()Whether the span is a root (no parent).- Returns:
- true for roots
-
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. -
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. -
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 '=='. -
traceId
Returns the value of thetraceIdrecord component.- Returns:
- the value of the
traceIdrecord component
-
spanId
Returns the value of thespanIdrecord component.- Returns:
- the value of the
spanIdrecord component
-
parentSpanId
Returns the value of theparentSpanIdrecord component.- Returns:
- the value of the
parentSpanIdrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
serviceName
Returns the value of theserviceNamerecord component.- Returns:
- the value of the
serviceNamerecord component
-
startMicros
public long startMicros()Returns the value of thestartMicrosrecord component.- Returns:
- the value of the
startMicrosrecord component
-
endMicros
public long endMicros()Returns the value of theendMicrosrecord component.- Returns:
- the value of the
endMicrosrecord component
-
durationMicros
public long durationMicros()Returns the value of thedurationMicrosrecord component.- Returns:
- the value of the
durationMicrosrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
events
Returns the value of theeventsrecord component.- Returns:
- the value of the
eventsrecord component
-
links
Returns the value of thelinksrecord component.- Returns:
- the value of the
linksrecord component
-