Package io.opencensus.trace
Class BlankSpan
java.lang.Object
io.opencensus.trace.Span
io.opencensus.trace.BlankSpan
The
BlankSpan
is a singleton class, which is the default Span
that is used when
no Span
implementation is available. All operations are no-op.
Used also to stop tracing, see Tracer.withSpan(io.opencensus.trace.Span)
.
- Since:
- 0.5
-
Nested Class Summary
Nested classes/interfaces inherited from class io.opencensus.trace.Span
Span.Kind, Span.Options
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(Annotation annotation) No-op implementation of theSpan.addAnnotation(Annotation)
method.void
addAnnotation
(String description, Map<String, AttributeValue> attributes) No-op implementation of theSpan.addAnnotation(String, Map)
method.void
No-op implementation of theSpan.addLink(Link)
method.void
addMessageEvent
(MessageEvent messageEvent) No-op implementation of theSpan.addMessageEvent(MessageEvent)
method.void
addNetworkEvent
(NetworkEvent networkEvent) Deprecated.void
end
(EndSpanOptions options) No-op implementation of theSpan.end(EndSpanOptions)
method.void
putAttribute
(String key, AttributeValue value) No-op implementation of theSpan.putAttribute(String, AttributeValue)
method.void
putAttributes
(Map<String, AttributeValue> attributes) No-op implementation of theSpan.putAttributes(Map)
method.void
Sets theStatus
to theSpan
.toString()
Methods inherited from class io.opencensus.trace.Span
addAnnotation, addAttributes, end, getContext, getOptions
-
Field Details
-
INSTANCE
Singleton instance of this class.- Since:
- 0.5
-
-
Constructor Details
-
BlankSpan
private BlankSpan()
-
-
Method Details
-
putAttribute
No-op implementation of theSpan.putAttribute(String, AttributeValue)
method.- Overrides:
putAttribute
in classSpan
- Parameters:
key
- the key for this attribute.value
- the value for this attribute.
-
putAttributes
No-op implementation of theSpan.putAttributes(Map)
method.- Overrides:
putAttributes
in classSpan
- Parameters:
attributes
- the attributes that will be added and associated with theSpan
.
-
addAnnotation
No-op implementation of theSpan.addAnnotation(String, Map)
method.- 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
No-op implementation of theSpan.addAnnotation(Annotation)
method.- Specified by:
addAnnotation
in classSpan
- Parameters:
annotation
- the annotations to add.
-
addNetworkEvent
Deprecated.No-op implementation of theSpan.addNetworkEvent(NetworkEvent)
method.- Overrides:
addNetworkEvent
in classSpan
- Parameters:
networkEvent
- the network event to add.
-
addMessageEvent
No-op implementation of theSpan.addMessageEvent(MessageEvent)
method.- Overrides:
addMessageEvent
in classSpan
- Parameters:
messageEvent
- the message to add.
-
addLink
No-op implementation of theSpan.addLink(Link)
method. -
setStatus
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
No-op implementation of theSpan.end(EndSpanOptions)
method. -
toString
-