Package io.opencensus.implcore.trace
Class NoRecordEventsSpanImpl
- java.lang.Object
-
- io.opencensus.trace.Span
-
- io.opencensus.implcore.trace.NoRecordEventsSpanImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.opencensus.trace.Span
Span.Kind, Span.Options
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.EnumSet<Span.Options>
NOT_RECORD_EVENTS_SPAN_OPTIONS
-
Constructor Summary
Constructors Modifier Constructor Description private
NoRecordEventsSpanImpl(SpanContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnotation(Annotation annotation)
Adds an annotation to theSpan
.void
addAnnotation(java.lang.String description, java.util.Map<java.lang.String,AttributeValue> attributes)
Adds an annotation to theSpan
.void
addLink(Link link)
Adds aLink
to theSpan
.void
addMessageEvent(MessageEvent messageEvent)
Adds a MessageEvent to theSpan
.(package private) static NoRecordEventsSpanImpl
create(SpanContext context)
void
end(EndSpanOptions options)
Marks the end ofSpan
execution with the given options.void
putAttribute(java.lang.String key, AttributeValue value)
Sets an attribute to theSpan
.void
putAttributes(java.util.Map<java.lang.String,AttributeValue> attributes)
Sets a set of attributes to theSpan
.void
setStatus(Status status)
Sets theStatus
to theSpan
.-
Methods inherited from class io.opencensus.trace.Span
addAnnotation, addAttributes, addNetworkEvent, end, getContext, getOptions
-
-
-
-
Field Detail
-
NOT_RECORD_EVENTS_SPAN_OPTIONS
private static final java.util.EnumSet<Span.Options> NOT_RECORD_EVENTS_SPAN_OPTIONS
-
-
Constructor Detail
-
NoRecordEventsSpanImpl
private NoRecordEventsSpanImpl(SpanContext context)
-
-
Method Detail
-
create
static NoRecordEventsSpanImpl create(SpanContext context)
-
addAnnotation
public void addAnnotation(java.lang.String description, java.util.Map<java.lang.String,AttributeValue> attributes)
Description copied from class:Span
Adds an annotation to theSpan
.- Specified by:
addAnnotation
in classSpan
- Parameters:
description
- the description of the annotation time event.attributes
- the attributes that will be added; these are associated with this annotation, not theSpan
as forSpan.putAttributes(Map)
.
-
addAnnotation
public void addAnnotation(Annotation annotation)
Description copied from class:Span
Adds an annotation to theSpan
.- Specified by:
addAnnotation
in classSpan
- Parameters:
annotation
- the annotations to add.
-
putAttribute
public void putAttribute(java.lang.String key, AttributeValue value)
Description copied from class:Span
Sets an attribute to theSpan
. If theSpan
previously contained a mapping for the key, the old value is replaced by the specified value.- Overrides:
putAttribute
in classSpan
- Parameters:
key
- the key for this attribute.value
- the value for this attribute.
-
putAttributes
public void putAttributes(java.util.Map<java.lang.String,AttributeValue> attributes)
Description copied from class:Span
Sets a set of attributes to theSpan
. The effect of this call is equivalent to that of callingSpan.putAttribute(String, AttributeValue)
once for each element in the specified map.- Overrides:
putAttributes
in classSpan
- Parameters:
attributes
- the attributes that will be added and associated with theSpan
.
-
addMessageEvent
public void addMessageEvent(MessageEvent messageEvent)
Description copied from class:Span
Adds a MessageEvent to theSpan
.This function can be used by higher level applications to record messaging event.
This method should always be overridden by users whose API versions are larger or equal to
0.12
.- Overrides:
addMessageEvent
in classSpan
- Parameters:
messageEvent
- the message to add.
-
addLink
public void addLink(Link link)
Description copied from class:Span
Adds aLink
to theSpan
.Used (for example) in batching operations, where a single batch handler processes multiple requests from different traces.
-
setStatus
public void setStatus(Status status)
Description copied from class:Span
Sets theStatus
to theSpan
.If used, this will override the default
Span
status. Default isStatus.OK
.Only the value of the last call will be recorded, and implementations are free to ignore previous calls. If the status is set via
EndSpanOptions.Builder.setStatus(Status)
that will always be the last call.
-
end
public void end(EndSpanOptions options)
Description copied from class:Span
Marks the end ofSpan
execution with the given options.Only the timing of the first end call for a given
Span
will be recorded, and implementations are free to ignore all further calls.
-
-