Package io.opencensus.trace
Class BlankSpan
- java.lang.Object
-
- io.opencensus.trace.Span
-
- io.opencensus.trace.BlankSpan
-
@Immutable public final class BlankSpan extends Span
TheBlankSpan
is a singleton class, which is the defaultSpan
that is used when noSpan
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
-
-
Constructor Summary
Constructors Modifier Constructor Description private
BlankSpan()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAnnotation(Annotation annotation)
No-op implementation of theSpan.addAnnotation(Annotation)
method.void
addAnnotation(java.lang.String description, java.util.Map<java.lang.String,AttributeValue> attributes)
No-op implementation of theSpan.addAnnotation(String, Map)
method.void
addLink(Link link)
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(java.lang.String key, AttributeValue value)
No-op implementation of theSpan.putAttribute(String, AttributeValue)
method.void
putAttributes(java.util.Map<java.lang.String,AttributeValue> attributes)
No-op implementation of theSpan.putAttributes(Map)
method.void
setStatus(Status status)
Sets theStatus
to theSpan
.java.lang.String
toString()
-
Methods inherited from class io.opencensus.trace.Span
addAnnotation, addAttributes, end, getContext, getOptions
-
-
-
-
Field Detail
-
INSTANCE
public static final BlankSpan INSTANCE
Singleton instance of this class.- Since:
- 0.5
-
-
Method Detail
-
putAttribute
public void putAttribute(java.lang.String key, AttributeValue value)
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
public void putAttributes(java.util.Map<java.lang.String,AttributeValue> attributes)
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
public void addAnnotation(java.lang.String description, java.util.Map<java.lang.String,AttributeValue> attributes)
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
public void addAnnotation(Annotation annotation)
No-op implementation of theSpan.addAnnotation(Annotation)
method.- Specified by:
addAnnotation
in classSpan
- Parameters:
annotation
- the annotations to add.
-
addNetworkEvent
@Deprecated public void addNetworkEvent(NetworkEvent networkEvent)
Deprecated.No-op implementation of theSpan.addNetworkEvent(NetworkEvent)
method.- Overrides:
addNetworkEvent
in classSpan
- Parameters:
networkEvent
- the network event to add.
-
addMessageEvent
public void addMessageEvent(MessageEvent messageEvent)
No-op implementation of theSpan.addMessageEvent(MessageEvent)
method.- Overrides:
addMessageEvent
in classSpan
- Parameters:
messageEvent
- the message to add.
-
addLink
public void addLink(Link link)
No-op implementation of theSpan.addLink(Link)
method.
-
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)
No-op implementation of theSpan.end(EndSpanOptions)
method.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-