Package io.opencensus.trace.export
Class SpanData
- java.lang.Object
-
- io.opencensus.trace.export.SpanData
-
- Direct Known Subclasses:
AutoValue_SpanData
@Immutable public abstract class SpanData extends java.lang.ObjectImmutable representation of all data collected by theSpanclass.- Since:
- 0.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpanData.AttributesA set of attributes and the number of dropped attributes representation.static classSpanData.LinksA list of links and the number of dropped links representation.static classSpanData.TimedEvent<T>A timed event representation.static classSpanData.TimedEvents<T>A list of timed events and the number of dropped events representation.
-
Constructor Summary
Constructors Constructor Description SpanData()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static SpanDatacreate(SpanContext context, SpanId parentSpanId, java.lang.Boolean hasRemoteParent, java.lang.String name, Timestamp startTimestamp, SpanData.Attributes attributes, SpanData.TimedEvents<Annotation> annotations, SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents, SpanData.Links links, java.lang.Integer childSpanCount, Status status, Timestamp endTimestamp)static SpanDatacreate(SpanContext context, SpanId parentSpanId, java.lang.Boolean hasRemoteParent, java.lang.String name, Span.Kind kind, Timestamp startTimestamp, SpanData.Attributes attributes, SpanData.TimedEvents<Annotation> annotations, SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents, SpanData.Links links, java.lang.Integer childSpanCount, Status status, Timestamp endTimestamp)Returns a new immutableSpanData.abstract SpanData.TimedEvents<Annotation>getAnnotations()Returns the annotations recorded for thisSpan.abstract SpanData.AttributesgetAttributes()Returns the attributes recorded for thisSpan.abstract java.lang.IntegergetChildSpanCount()Returns the number of child spans that were generated while theSpanwas running.abstract SpanContextgetContext()Returns theSpanContextassociated with thisSpan.abstract TimestampgetEndTimestamp()Returns the endTimestampornullif theSpanis still active.abstract java.lang.BooleangetHasRemoteParent()Returnstrueif the parent is on a different process.abstract Span.KindgetKind()Returns the kind of thisSpan.abstract SpanData.LinksgetLinks()Returns links recorded for thisSpan.abstract SpanData.TimedEvents<MessageEvent>getMessageEvents()Returns message events recorded for thisSpan.abstract java.lang.StringgetName()Returns the name of thisSpan.SpanData.TimedEvents<NetworkEvent>getNetworkEvents()Deprecated.UsegetMessageEvents().abstract SpanIdgetParentSpanId()Returns the parentSpanIdornullif theSpanis a rootSpan.abstract TimestampgetStartTimestamp()Returns the startTimestampof thisSpan.abstract StatusgetStatus()Returns theStatusornullifSpanis still active.
-
-
-
Method Detail
-
create
@Deprecated public static SpanData create(SpanContext context, @Nullable SpanId parentSpanId, @Nullable java.lang.Boolean hasRemoteParent, java.lang.String name, Timestamp startTimestamp, SpanData.Attributes attributes, SpanData.TimedEvents<Annotation> annotations, SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents, SpanData.Links links, @Nullable java.lang.Integer childSpanCount, @Nullable Status status, @Nullable Timestamp endTimestamp)
Deprecated.Returns a new immutableSpanData.
-
create
public static SpanData create(SpanContext context, @Nullable SpanId parentSpanId, @Nullable java.lang.Boolean hasRemoteParent, java.lang.String name, @Nullable Span.Kind kind, Timestamp startTimestamp, SpanData.Attributes attributes, SpanData.TimedEvents<Annotation> annotations, SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents, SpanData.Links links, @Nullable java.lang.Integer childSpanCount, @Nullable Status status, @Nullable Timestamp endTimestamp)
Returns a new immutableSpanData.- Parameters:
context- theSpanContextof theSpan.parentSpanId- the parentSpanIdof theSpan.nullif theSpanis a root.hasRemoteParent-trueif the parentSpanis remote.nullif this is a root span.name- the name of theSpan.kind- the kind of theSpan.startTimestamp- the startTimestampof theSpan.attributes- the attributes associated with theSpan.annotations- the annotations associated with theSpan.messageOrNetworkEvents- the message events (or network events for backward compatibility) associated with theSpan.links- the links associated with theSpan.childSpanCount- the number of child spans that were generated while the span was active.status- theStatusof theSpan.nullif theSpanis still active.endTimestamp- the endTimestampof theSpan.nullif theSpanis still active.- Returns:
- a new immutable
SpanData. - Since:
- 0.14
-
getContext
public abstract SpanContext getContext()
Returns theSpanContextassociated with thisSpan.- Returns:
- the
SpanContextassociated with thisSpan. - Since:
- 0.5
-
getParentSpanId
@Nullable public abstract SpanId getParentSpanId()
Returns the parentSpanIdornullif theSpanis a rootSpan.- Returns:
- the parent
SpanIdornullif theSpanis a rootSpan. - Since:
- 0.5
-
getHasRemoteParent
@Nullable public abstract java.lang.Boolean getHasRemoteParent()
Returnstrueif the parent is on a different process.nullif this is a root span.- Returns:
trueif the parent is on a different process.nullif this is a root span.- Since:
- 0.5
-
getName
public abstract java.lang.String getName()
Returns the name of thisSpan.- Returns:
- the name of this
Span. - Since:
- 0.5
-
getKind
@Nullable public abstract Span.Kind getKind()
Returns the kind of thisSpan.- Returns:
- the kind of this
Span. - Since:
- 0.14
-
getStartTimestamp
public abstract Timestamp getStartTimestamp()
Returns the startTimestampof thisSpan.- Returns:
- the start
Timestampof thisSpan. - Since:
- 0.5
-
getAttributes
public abstract SpanData.Attributes getAttributes()
Returns the attributes recorded for thisSpan.- Returns:
- the attributes recorded for this
Span. - Since:
- 0.5
-
getAnnotations
public abstract SpanData.TimedEvents<Annotation> getAnnotations()
Returns the annotations recorded for thisSpan.- Returns:
- the annotations recorded for this
Span. - Since:
- 0.5
-
getNetworkEvents
@Deprecated public SpanData.TimedEvents<NetworkEvent> getNetworkEvents()
Deprecated.UsegetMessageEvents().Returns network events recorded for thisSpan.- Returns:
- network events recorded for this
Span. - Since:
- 0.5
-
getMessageEvents
public abstract SpanData.TimedEvents<MessageEvent> getMessageEvents()
Returns message events recorded for thisSpan.- Returns:
- message events recorded for this
Span. - Since:
- 0.12
-
getLinks
public abstract SpanData.Links getLinks()
Returns links recorded for thisSpan.- Returns:
- links recorded for this
Span. - Since:
- 0.5
-
getChildSpanCount
@Nullable public abstract java.lang.Integer getChildSpanCount()
Returns the number of child spans that were generated while theSpanwas running. If notnullallows service implementations to detect missing child spans.This information is not always available.
- Returns:
- the number of child spans that were generated while the
Spanwas running. - Since:
- 0.5
-
getStatus
@Nullable public abstract Status getStatus()
Returns theStatusornullifSpanis still active.- Returns:
- the
StatusornullifSpanis still active. - Since:
- 0.5
-
getEndTimestamp
@Nullable public abstract Timestamp getEndTimestamp()
Returns the endTimestampornullif theSpanis still active.- Returns:
- the end
Timestampornullif theSpanis still active. - Since:
- 0.5
-
-