Package io.opencensus.trace.export
Class SpanData
java.lang.Object
io.opencensus.trace.export.SpanData
- Direct Known Subclasses:
AutoValue_SpanData
Immutable representation of all data collected by the
Span
class.- Since:
- 0.5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A set of attributes and the number of dropped attributes representation.static class
A list of links and the number of dropped links representation.static class
A timed event representation.static class
A list of timed events and the number of dropped events representation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SpanData
create
(SpanContext context, SpanId parentSpanId, Boolean hasRemoteParent, String name, Timestamp startTimestamp, SpanData.Attributes attributes, SpanData.TimedEvents<Annotation> annotations, SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents, SpanData.Links links, Integer childSpanCount, Status status, Timestamp endTimestamp) Deprecated.static SpanData
create
(SpanContext context, SpanId parentSpanId, Boolean hasRemoteParent, String name, Span.Kind kind, Timestamp startTimestamp, SpanData.Attributes attributes, SpanData.TimedEvents<Annotation> annotations, SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents, SpanData.Links links, Integer childSpanCount, Status status, Timestamp endTimestamp) Returns a new immutableSpanData
.abstract SpanData.TimedEvents
<Annotation> Returns the annotations recorded for thisSpan
.abstract SpanData.Attributes
Returns the attributes recorded for thisSpan
.abstract Integer
Returns the number of child spans that were generated while theSpan
was running.abstract SpanContext
Returns theSpanContext
associated with thisSpan
.abstract Timestamp
Returns the endTimestamp
ornull
if theSpan
is still active.abstract Boolean
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> Returns message events recorded for thisSpan
.abstract String
getName()
Returns the name of thisSpan
.Deprecated.UsegetMessageEvents()
.abstract SpanId
Returns the parentSpanId
ornull
if theSpan
is a rootSpan
.abstract Timestamp
Returns the startTimestamp
of thisSpan
.abstract Status
Returns theStatus
ornull
ifSpan
is still active.
-
Constructor Details
-
SpanData
SpanData()
-
-
Method Details
-
create
@Deprecated public static SpanData create(SpanContext context, @Nullable SpanId parentSpanId, @Nullable Boolean hasRemoteParent, String name, Timestamp startTimestamp, SpanData.Attributes attributes, SpanData.TimedEvents<Annotation> annotations, SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents, SpanData.Links links, @Nullable Integer childSpanCount, @Nullable Status status, @Nullable Timestamp endTimestamp) Deprecated.Returns a new immutableSpanData
. -
create
public static SpanData create(SpanContext context, @Nullable SpanId parentSpanId, @Nullable Boolean hasRemoteParent, String name, @Nullable Span.Kind kind, Timestamp startTimestamp, SpanData.Attributes attributes, SpanData.TimedEvents<Annotation> annotations, SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents, SpanData.Links links, @Nullable 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
Returns theSpanContext
associated with thisSpan
.- Returns:
- the
SpanContext
associated with thisSpan
. - Since:
- 0.5
-
getParentSpanId
Returns the parentSpanId
ornull
if theSpan
is a rootSpan
.- Returns:
- the parent
SpanId
ornull
if theSpan
is a rootSpan
. - Since:
- 0.5
-
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
Returns the name of thisSpan
.- Returns:
- the name of this
Span
. - Since:
- 0.5
-
getKind
Returns the kind of thisSpan
.- Returns:
- the kind of this
Span
. - Since:
- 0.14
-
getStartTimestamp
Returns the startTimestamp
of thisSpan
.- Returns:
- the start
Timestamp
of thisSpan
. - Since:
- 0.5
-
getAttributes
Returns the attributes recorded for thisSpan
.- Returns:
- the attributes recorded for this
Span
. - Since:
- 0.5
-
getAnnotations
Returns the annotations recorded for thisSpan
.- Returns:
- the annotations recorded for this
Span
. - Since:
- 0.5
-
getNetworkEvents
Deprecated.UsegetMessageEvents()
.Returns network events recorded for thisSpan
.- Returns:
- network events recorded for this
Span
. - Since:
- 0.5
-
getMessageEvents
Returns message events recorded for thisSpan
.- Returns:
- message events recorded for this
Span
. - Since:
- 0.12
-
getLinks
Returns links recorded for thisSpan
.- Returns:
- links recorded for this
Span
. - Since:
- 0.5
-
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
Returns theStatus
ornull
ifSpan
is still active.- Returns:
- the
Status
ornull
ifSpan
is still active. - Since:
- 0.5
-
getEndTimestamp
Returns the endTimestamp
ornull
if theSpan
is still active.- Returns:
- the end
Timestamp
ornull
if theSpan
is still active. - Since:
- 0.5
-
create(SpanContext, SpanId, Boolean, String, Kind, Timestamp, Attributes, TimedEvents, TimedEvents, Links, Integer, Status, Timestamp)
.