Package io.opentelemetry.sdk.trace
Class SpanWrapper
java.lang.Object
io.opentelemetry.sdk.trace.SpanWrapper
- All Implemented Interfaces:
SpanData
- Direct Known Subclasses:
AutoValue_SpanWrapper
Immutable class that stores
SpanData
based on a SdkSpan
.
This class stores a reference to a mutable SdkSpan
(delegate
) which it uses
only the immutable parts from, and a copy of all the mutable parts.
When adding a new field to SdkSpan
, store a copy if and only if the field is mutable
in the SdkSpan
. Otherwise retrieve it from the referenced SdkSpan
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract Attributes
(package private) static SpanWrapper
create
(SdkSpan delegate, List<LinkData> links, List<EventData> events, Attributes attributes, int totalAttributeCount, int totalRecordedEvents, int totalRecordedLinks, StatusData status, String name, long endEpochNanos, boolean hasEnded) Note: the collections that are passed into this creator method are assumed to be immutable to preserve the overall immutability of the class.(package private) abstract SdkSpan
delegate()
(package private) abstract long
Returns the attributes recorded for thisSpan
.long
Returns the end epoch timestamp in nanos of thisSpan
.Returns the timed events recorded for thisSpan
.Deprecated.Returns the instrumentation scope specified when creating the tracer which produced thisSpan
.getKind()
Returns the kind of thisSpan
.getLinks()
Returns links recorded for thisSpan
.getName()
Returns the name of thisSpan
.Returns the parentSpanContext
.Returns the resource of thisSpan
.Returns theSpanContext
of the Span.long
Returns the start epoch timestamp in nanos of thisSpan
.Returns theStatus
.int
The total number of attributes that were recorded on this span.int
The total number ofEventData
events that were recorded on this span.int
The total number ofLinkData
links that were recorded on this span.boolean
hasEnded()
Returns whether this Span has already been ended.(package private) abstract boolean
(package private) abstract String
name()
(package private) abstract StatusData
status()
final String
toString()
(package private) abstract int
(package private) abstract int
(package private) abstract int
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.opentelemetry.sdk.trace.data.SpanData
getParentSpanId, getSpanId, getTraceId
-
Constructor Details
-
SpanWrapper
SpanWrapper()
-
-
Method Details
-
delegate
-
resolvedLinks
-
resolvedEvents
-
attributes
-
totalAttributeCount
abstract int totalAttributeCount() -
totalRecordedEvents
abstract int totalRecordedEvents() -
totalRecordedLinks
abstract int totalRecordedLinks() -
status
-
name
-
endEpochNanos
abstract long endEpochNanos() -
internalHasEnded
abstract boolean internalHasEnded() -
create
static SpanWrapper create(SdkSpan delegate, List<LinkData> links, List<EventData> events, Attributes attributes, int totalAttributeCount, int totalRecordedEvents, int totalRecordedLinks, StatusData status, String name, long endEpochNanos, boolean hasEnded) Note: the collections that are passed into this creator method are assumed to be immutable to preserve the overall immutability of the class. -
getSpanContext
Description copied from interface:SpanData
Returns theSpanContext
of the Span.- Specified by:
getSpanContext
in interfaceSpanData
-
getParentSpanContext
Description copied from interface:SpanData
Returns the parentSpanContext
. If the span is a root span, theSpanContext
returned will be invalid.- Specified by:
getParentSpanContext
in interfaceSpanData
-
getResource
Description copied from interface:SpanData
Returns the resource of thisSpan
.- Specified by:
getResource
in interfaceSpanData
- Returns:
- the resource of this
Span
.
-
getInstrumentationLibraryInfo
Deprecated.Description copied from interface:SpanData
Returns the instrumentation library specified when creating the tracer which produced thisSpan
.- Specified by:
getInstrumentationLibraryInfo
in interfaceSpanData
- Returns:
- an instance of
InstrumentationLibraryInfo
-
getInstrumentationScopeInfo
Description copied from interface:SpanData
Returns the instrumentation scope specified when creating the tracer which produced thisSpan
.- Specified by:
getInstrumentationScopeInfo
in interfaceSpanData
- Returns:
- an instance of
InstrumentationScopeInfo
-
getName
Description copied from interface:SpanData
Returns the name of thisSpan
. -
getKind
Description copied from interface:SpanData
Returns the kind of thisSpan
. -
getStartEpochNanos
public long getStartEpochNanos()Description copied from interface:SpanData
Returns the start epoch timestamp in nanos of thisSpan
.- Specified by:
getStartEpochNanos
in interfaceSpanData
- Returns:
- the start epoch timestamp in nanos of this
Span
.
-
getAttributes
Description copied from interface:SpanData
Returns the attributes recorded for thisSpan
.- Specified by:
getAttributes
in interfaceSpanData
- Returns:
- the attributes recorded for this
Span
.
-
getEvents
Description copied from interface:SpanData
Returns the timed events recorded for thisSpan
. -
getLinks
Description copied from interface:SpanData
Returns links recorded for thisSpan
. -
getStatus
Description copied from interface:SpanData
Returns theStatus
. -
getEndEpochNanos
public long getEndEpochNanos()Description copied from interface:SpanData
Returns the end epoch timestamp in nanos of thisSpan
.- Specified by:
getEndEpochNanos
in interfaceSpanData
- Returns:
- the end epoch timestamp in nanos of this
Span
.
-
hasEnded
public boolean hasEnded()Description copied from interface:SpanData
Returns whether this Span has already been ended. -
getTotalRecordedEvents
public int getTotalRecordedEvents()Description copied from interface:SpanData
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()
- Specified by:
getTotalRecordedEvents
in interfaceSpanData
- Returns:
- The total number of events recorded on this span.
-
getTotalRecordedLinks
public int getTotalRecordedLinks()Description copied from interface:SpanData
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()
- Specified by:
getTotalRecordedLinks
in interfaceSpanData
- Returns:
- The total number of links recorded on this span.
-
getTotalAttributeCount
public int getTotalAttributeCount()Description copied from interface:SpanData
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()
- Specified by:
getTotalAttributeCount
in interfaceSpanData
- Returns:
- The total number of attributes on this span.
-
toString
-