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 abstract class SpanWrapper extends java.lang.Object implements SpanData
Immutable class that storesSpanDatabased on aSdkSpan.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 theSdkSpan. Otherwise retrieve it from the referencedSdkSpan.
-
-
Constructor Summary
Constructors Constructor Description SpanWrapper()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) abstract Attributesattributes()(package private) static SpanWrappercreate(SdkSpan delegate, java.util.List<LinkData> links, java.util.List<EventData> events, Attributes attributes, int totalAttributeCount, int totalRecordedEvents, int totalRecordedLinks, StatusData status, java.lang.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 SdkSpandelegate()(package private) abstract longendEpochNanos()AttributesgetAttributes()Returns the attributes recorded for thisSpan.longgetEndEpochNanos()Returns the end epoch timestamp in nanos of thisSpan.java.util.List<EventData>getEvents()Returns the timed events recorded for thisSpan.InstrumentationLibraryInfogetInstrumentationLibraryInfo()Deprecated.InstrumentationScopeInfogetInstrumentationScopeInfo()Returns the instrumentation scope specified when creating the tracer which produced thisSpan.SpanKindgetKind()Returns the kind of thisSpan.java.util.List<LinkData>getLinks()Returns links recorded for thisSpan.java.lang.StringgetName()Returns the name of thisSpan.SpanContextgetParentSpanContext()Returns the parentSpanContext.ResourcegetResource()Returns the resource of thisSpan.SpanContextgetSpanContext()Returns theSpanContextof the 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.booleanhasEnded()Returns whether this Span has already been ended.(package private) abstract booleaninternalHasEnded()(package private) abstract java.lang.Stringname()(package private) abstract java.util.List<EventData>resolvedEvents()(package private) abstract java.util.List<LinkData>resolvedLinks()(package private) abstract StatusDatastatus()java.lang.StringtoString()(package private) abstract inttotalAttributeCount()(package private) abstract inttotalRecordedEvents()(package private) abstract inttotalRecordedLinks()-
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
-
-
-
-
Method Detail
-
delegate
abstract SdkSpan delegate()
-
resolvedLinks
abstract java.util.List<LinkData> resolvedLinks()
-
resolvedEvents
abstract java.util.List<EventData> resolvedEvents()
-
attributes
abstract Attributes attributes()
-
totalAttributeCount
abstract int totalAttributeCount()
-
totalRecordedEvents
abstract int totalRecordedEvents()
-
totalRecordedLinks
abstract int totalRecordedLinks()
-
status
abstract StatusData status()
-
name
abstract java.lang.String name()
-
endEpochNanos
abstract long endEpochNanos()
-
internalHasEnded
abstract boolean internalHasEnded()
-
create
static SpanWrapper create(SdkSpan delegate, java.util.List<LinkData> links, java.util.List<EventData> events, Attributes attributes, int totalAttributeCount, int totalRecordedEvents, int totalRecordedLinks, StatusData status, java.lang.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
public SpanContext getSpanContext()
Description copied from interface:SpanDataReturns theSpanContextof the Span.- Specified by:
getSpanContextin interfaceSpanData
-
getParentSpanContext
public SpanContext getParentSpanContext()
Description copied from interface:SpanDataReturns the parentSpanContext. If the span is a root span, theSpanContextreturned will be invalid.- Specified by:
getParentSpanContextin interfaceSpanData
-
getResource
public Resource getResource()
Description copied from interface:SpanDataReturns the resource of thisSpan.- Specified by:
getResourcein interfaceSpanData- Returns:
- the resource of this
Span.
-
getInstrumentationLibraryInfo
@Deprecated public InstrumentationLibraryInfo getInstrumentationLibraryInfo()
Deprecated.Description copied from interface:SpanDataReturns the instrumentation library specified when creating the tracer which produced thisSpan.- Specified by:
getInstrumentationLibraryInfoin interfaceSpanData- Returns:
- an instance of
InstrumentationLibraryInfo
-
getInstrumentationScopeInfo
public InstrumentationScopeInfo getInstrumentationScopeInfo()
Description copied from interface:SpanDataReturns the instrumentation scope specified when creating the tracer which produced thisSpan.- Specified by:
getInstrumentationScopeInfoin interfaceSpanData- Returns:
- an instance of
InstrumentationScopeInfo
-
getName
public java.lang.String getName()
Description copied from interface:SpanDataReturns the name of thisSpan.
-
getKind
public SpanKind getKind()
Description copied from interface:SpanDataReturns the kind of thisSpan.
-
getStartEpochNanos
public long getStartEpochNanos()
Description copied from interface:SpanDataReturns the start epoch timestamp in nanos of thisSpan.- Specified by:
getStartEpochNanosin interfaceSpanData- Returns:
- the start epoch timestamp in nanos of this
Span.
-
getAttributes
public Attributes getAttributes()
Description copied from interface:SpanDataReturns the attributes recorded for thisSpan.- Specified by:
getAttributesin interfaceSpanData- Returns:
- the attributes recorded for this
Span.
-
getEvents
public java.util.List<EventData> getEvents()
Description copied from interface:SpanDataReturns the timed events recorded for thisSpan.
-
getLinks
public java.util.List<LinkData> getLinks()
Description copied from interface:SpanDataReturns links recorded for thisSpan.
-
getStatus
public StatusData getStatus()
Description copied from interface:SpanDataReturns theStatus.
-
getEndEpochNanos
public long getEndEpochNanos()
Description copied from interface:SpanDataReturns the end epoch timestamp in nanos of thisSpan.- Specified by:
getEndEpochNanosin interfaceSpanData- Returns:
- the end epoch timestamp in nanos of this
Span.
-
hasEnded
public boolean hasEnded()
Description copied from interface:SpanDataReturns whether this Span has already been ended.
-
getTotalRecordedEvents
public int getTotalRecordedEvents()
Description copied from interface:SpanDataThe 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()- Specified by:
getTotalRecordedEventsin interfaceSpanData- Returns:
- The total number of events recorded on this span.
-
getTotalRecordedLinks
public int getTotalRecordedLinks()
Description copied from interface:SpanDataThe 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()- Specified by:
getTotalRecordedLinksin interfaceSpanData- Returns:
- The total number of links recorded on this span.
-
getTotalAttributeCount
public int getTotalAttributeCount()
Description copied from interface:SpanDataThe 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:
getTotalAttributeCountin interfaceSpanData- Returns:
- The total number of attributes on this span.
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-