Package io.opentelemetry.sdk.trace.data
Interface SpanData
-
@Immutable public interface SpanDataImmutable representation of all data collected by theSpanclass.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description io.opentelemetry.api.common.AttributesgetAttributes()Returns the attributes recorded for thisSpan.longgetEndEpochNanos()Returns the end epoch timestamp in nanos of thisSpan.List<EventData>getEvents()Returns the timed events recorded for thisSpan.io.opentelemetry.sdk.common.InstrumentationLibraryInfogetInstrumentationLibraryInfo()Returns the instrumentation library specified when creating the tracer which produced thisSpan.io.opentelemetry.api.trace.SpanKindgetKind()Returns the kind of thisSpan.List<LinkData>getLinks()Returns links recorded for thisSpan.StringgetName()Returns the name of thisSpan.io.opentelemetry.api.trace.SpanContextgetParentSpanContext()Returns the parentSpanContext.default StringgetParentSpanId()Returns the parentSpanId.io.opentelemetry.sdk.resources.ResourcegetResource()Returns the resource of thisSpan.io.opentelemetry.api.trace.SpanContextgetSpanContext()Returns theSpanContextof the Span.default StringgetSpanId()Gets the span id for this span.longgetStartEpochNanos()Returns the start epoch timestamp in nanos of thisSpan.StatusDatagetStatus()Returns theStatus.intgetTotalAttributeCount()The total number of attributes that were recorded on this span.intgetTotalRecordedEvents()The total number ofEventDataevents that were recorded on this span.intgetTotalRecordedLinks()The total number ofLinkDatalinks that were recorded on this span.default StringgetTraceId()Gets the trace id for this span.booleanhasEnded()Returns whether this Span has already been ended.
-
-
-
Method Detail
-
getName
String getName()
Returns the name of thisSpan.- Returns:
- the name of this
Span.
-
getKind
io.opentelemetry.api.trace.SpanKind getKind()
Returns the kind of thisSpan.- Returns:
- the kind of this
Span.
-
getSpanContext
io.opentelemetry.api.trace.SpanContext getSpanContext()
Returns theSpanContextof the Span.
-
getTraceId
default String getTraceId()
Gets the trace id for this span.- Returns:
- the trace id.
-
getSpanId
default String getSpanId()
Gets the span id for this span.- Returns:
- the span id.
-
getParentSpanContext
io.opentelemetry.api.trace.SpanContext getParentSpanContext()
Returns the parentSpanContext. If the span is a root span, theSpanContextreturned will be invalid.
-
getParentSpanId
default String getParentSpanId()
Returns the parentSpanId. If theSpanis a rootSpan, the SpanId returned will be invalid.- Returns:
- the parent
SpanIdor an invalid SpanId if this is a rootSpan.
-
getStatus
StatusData getStatus()
Returns theStatus.- Returns:
- the
Status.
-
getStartEpochNanos
long getStartEpochNanos()
Returns the start epoch timestamp in nanos of thisSpan.- Returns:
- the start epoch timestamp in nanos of this
Span.
-
getAttributes
io.opentelemetry.api.common.Attributes getAttributes()
Returns the attributes recorded for thisSpan.- Returns:
- the attributes recorded for this
Span.
-
getEvents
List<EventData> getEvents()
Returns the timed events recorded for thisSpan.- Returns:
- the timed events recorded for this
Span.
-
getLinks
List<LinkData> getLinks()
Returns links recorded for thisSpan.- Returns:
- links recorded for this
Span.
-
getEndEpochNanos
long getEndEpochNanos()
Returns the end epoch timestamp in nanos of thisSpan.- Returns:
- the end epoch timestamp in nanos of this
Span.
-
hasEnded
boolean hasEnded()
Returns whether this Span has already been ended.- Returns:
trueif the span has already been ended,falseif not.
-
getTotalRecordedEvents
int getTotalRecordedEvents()
The total number ofEventDataevents that were recorded on this span. This number may be larger than the number of events that are attached to this span, if the total number recorded was greater than the configured maximum value. See:SpanLimits.getMaxNumberOfEvents()- Returns:
- The total number of events recorded on this span.
-
getTotalRecordedLinks
int getTotalRecordedLinks()
The total number ofLinkDatalinks that were recorded on this span. This number may be larger than the number of links that are attached to this span, if the total number recorded was greater than the configured maximum value. See:SpanLimits.getMaxNumberOfLinks()- Returns:
- The total number of links recorded on this span.
-
getTotalAttributeCount
int getTotalAttributeCount()
The total number of attributes that were recorded on this span. This number may be larger than the number of attributes that are attached to this span, if the total number recorded was greater than the configured maximum value. See:SpanLimits.getMaxNumberOfAttributes()- Returns:
- The total number of attributes on this span.
-
getInstrumentationLibraryInfo
io.opentelemetry.sdk.common.InstrumentationLibraryInfo getInstrumentationLibraryInfo()
Returns the instrumentation library specified when creating the tracer which produced thisSpan.- Returns:
- an instance of
InstrumentationLibraryInfo
-
getResource
io.opentelemetry.sdk.resources.Resource getResource()
Returns the resource of thisSpan.- Returns:
- the resource of this
Span.
-
-