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.Object
Immutable representation of all data collected by theSpan
class.- Since:
- 0.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpanData.Attributes
A set of attributes and the number of dropped attributes representation.static class
SpanData.Links
A list of links and the number of dropped links representation.static class
SpanData.TimedEvent<T>
A timed event representation.static class
SpanData.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 SpanData
create(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 SpanData
create(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.Attributes
getAttributes()
Returns the attributes recorded for thisSpan
.abstract java.lang.Integer
getChildSpanCount()
Returns the number of child spans that were generated while theSpan
was running.abstract SpanContext
getContext()
Returns theSpanContext
associated with thisSpan
.abstract Timestamp
getEndTimestamp()
Returns the endTimestamp
ornull
if theSpan
is still active.abstract java.lang.Boolean
getHasRemoteParent()
Returnstrue
if the parent is on a different process.abstract Span.Kind
getKind()
Returns the kind of thisSpan
.abstract SpanData.Links
getLinks()
Returns links recorded for thisSpan
.abstract SpanData.TimedEvents<MessageEvent>
getMessageEvents()
Returns message events recorded for thisSpan
.abstract java.lang.String
getName()
Returns the name of thisSpan
.SpanData.TimedEvents<NetworkEvent>
getNetworkEvents()
Deprecated.UsegetMessageEvents()
.abstract SpanId
getParentSpanId()
Returns the parentSpanId
ornull
if theSpan
is a rootSpan
.abstract Timestamp
getStartTimestamp()
Returns the startTimestamp
of thisSpan
.abstract Status
getStatus()
Returns theStatus
ornull
ifSpan
is 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
- theSpanContext
of theSpan
.parentSpanId
- the parentSpanId
of theSpan
.null
if theSpan
is a root.hasRemoteParent
-true
if the parentSpan
is remote.null
if this is a root span.name
- the name of theSpan
.kind
- the kind of theSpan
.startTimestamp
- the startTimestamp
of 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
- theStatus
of theSpan
.null
if theSpan
is still active.endTimestamp
- the endTimestamp
of theSpan
.null
if theSpan
is still active.- Returns:
- a new immutable
SpanData
. - Since:
- 0.14
-
getContext
public abstract SpanContext getContext()
Returns theSpanContext
associated with thisSpan
.- Returns:
- the
SpanContext
associated with thisSpan
. - Since:
- 0.5
-
getParentSpanId
@Nullable public abstract SpanId getParentSpanId()
Returns the parentSpanId
ornull
if theSpan
is a rootSpan
.- Returns:
- the parent
SpanId
ornull
if theSpan
is a rootSpan
. - Since:
- 0.5
-
getHasRemoteParent
@Nullable public abstract java.lang.Boolean getHasRemoteParent()
Returnstrue
if the parent is on a different process.null
if this is a root span.- Returns:
true
if the parent is on a different process.null
if 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 startTimestamp
of thisSpan
.- Returns:
- the start
Timestamp
of 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 theSpan
was running. If notnull
allows service implementations to detect missing child spans.This information is not always available.
- Returns:
- the number of child spans that were generated while the
Span
was running. - Since:
- 0.5
-
getStatus
@Nullable public abstract Status getStatus()
Returns theStatus
ornull
ifSpan
is still active.- Returns:
- the
Status
ornull
ifSpan
is still active. - Since:
- 0.5
-
getEndTimestamp
@Nullable public abstract Timestamp getEndTimestamp()
Returns the endTimestamp
ornull
if theSpan
is still active.- Returns:
- the end
Timestamp
ornull
if theSpan
is still active. - Since:
- 0.5
-
-