Package io.opentelemetry.sdk.trace.data
Interface SpanData
-
- All Known Implementing Classes:
AutoValue_SpanWrapper
,DelegatingSpanData
,SpanWrapper
@Immutable public interface SpanData
Immutable representation of all data collected by theSpan
class.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Attributes
getAttributes()
Returns the attributes recorded for thisSpan
.long
getEndEpochNanos()
Returns the end epoch timestamp in nanos of thisSpan
.java.util.List<EventData>
getEvents()
Returns the timed events recorded for thisSpan
.InstrumentationLibraryInfo
getInstrumentationLibraryInfo()
Deprecated.default InstrumentationScopeInfo
getInstrumentationScopeInfo()
Returns the instrumentation scope specified when creating the tracer which produced thisSpan
.SpanKind
getKind()
Returns the kind of thisSpan
.java.util.List<LinkData>
getLinks()
Returns links recorded for thisSpan
.java.lang.String
getName()
Returns the name of thisSpan
.SpanContext
getParentSpanContext()
Returns the parentSpanContext
.default java.lang.String
getParentSpanId()
Returns the parentSpanId
.Resource
getResource()
Returns the resource of thisSpan
.SpanContext
getSpanContext()
Returns theSpanContext
of the Span.default java.lang.String
getSpanId()
Gets the span id for this span.long
getStartEpochNanos()
Returns the start epoch timestamp in nanos of thisSpan
.StatusData
getStatus()
Returns theStatus
.int
getTotalAttributeCount()
The total number of attributes that were recorded on this span.int
getTotalRecordedEvents()
The total number ofEventData
events that were recorded on this span.int
getTotalRecordedLinks()
The total number ofLinkData
links that were recorded on this span.default java.lang.String
getTraceId()
Gets the trace id for this span.boolean
hasEnded()
Returns whether this Span has already been ended.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of thisSpan
.- Returns:
- the name of this
Span
.
-
getKind
SpanKind getKind()
Returns the kind of thisSpan
.- Returns:
- the kind of this
Span
.
-
getSpanContext
SpanContext getSpanContext()
Returns theSpanContext
of the Span.
-
getTraceId
default java.lang.String getTraceId()
Gets the trace id for this span.- Returns:
- the trace id.
-
getSpanId
default java.lang.String getSpanId()
Gets the span id for this span.- Returns:
- the span id.
-
getParentSpanContext
SpanContext getParentSpanContext()
Returns the parentSpanContext
. If the span is a root span, theSpanContext
returned will be invalid.
-
getParentSpanId
default java.lang.String getParentSpanId()
Returns the parentSpanId
. If theSpan
is a rootSpan
, the SpanId returned will be invalid.- Returns:
- the parent
SpanId
or 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
Attributes getAttributes()
Returns the attributes recorded for thisSpan
.- Returns:
- the attributes recorded for this
Span
.
-
getEvents
java.util.List<EventData> getEvents()
Returns the timed events recorded for thisSpan
.- Returns:
- the timed events recorded for this
Span
.
-
getLinks
java.util.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:
true
if the span has already been ended,false
if not.
-
getTotalRecordedEvents
int getTotalRecordedEvents()
The total number ofEventData
events 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 ofLinkData
links 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
@Deprecated InstrumentationLibraryInfo getInstrumentationLibraryInfo()
Deprecated.Returns the instrumentation library specified when creating the tracer which produced thisSpan
.- Returns:
- an instance of
InstrumentationLibraryInfo
-
getInstrumentationScopeInfo
default InstrumentationScopeInfo getInstrumentationScopeInfo()
Returns the instrumentation scope specified when creating the tracer which produced thisSpan
.- Returns:
- an instance of
InstrumentationScopeInfo
-
getResource
Resource getResource()
Returns the resource of thisSpan
.- Returns:
- the resource of this
Span
.
-
-