Package io.opencensus.trace
Class BlankSpan
- java.lang.Object
-
- io.opencensus.trace.Span
-
- io.opencensus.trace.BlankSpan
-
@Immutable public final class BlankSpan extends Span
TheBlankSpanis a singleton class, which is the defaultSpanthat is used when noSpanimplementation 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 privateBlankSpan()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAnnotation(Annotation annotation)No-op implementation of theSpan.addAnnotation(Annotation)method.voidaddAnnotation(java.lang.String description, java.util.Map<java.lang.String,AttributeValue> attributes)No-op implementation of theSpan.addAnnotation(String, Map)method.voidaddLink(Link link)No-op implementation of theSpan.addLink(Link)method.voidaddMessageEvent(MessageEvent messageEvent)No-op implementation of theSpan.addMessageEvent(MessageEvent)method.voidaddNetworkEvent(NetworkEvent networkEvent)Deprecated.voidend(EndSpanOptions options)No-op implementation of theSpan.end(EndSpanOptions)method.voidputAttribute(java.lang.String key, AttributeValue value)No-op implementation of theSpan.putAttribute(String, AttributeValue)method.voidputAttributes(java.util.Map<java.lang.String,AttributeValue> attributes)No-op implementation of theSpan.putAttributes(Map)method.voidsetStatus(Status status)Sets theStatusto theSpan.java.lang.StringtoString()-
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:
putAttributein 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:
putAttributesin 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:
addAnnotationin classSpan- Parameters:
description- the description of the annotation time event.attributes- the attributes that will be added; these are associated with this annotation, not theSpanas forSpan.putAttributes(Map).
-
addAnnotation
public void addAnnotation(Annotation annotation)
No-op implementation of theSpan.addAnnotation(Annotation)method.- Specified by:
addAnnotationin classSpan- Parameters:
annotation- the annotations to add.
-
addNetworkEvent
@Deprecated public void addNetworkEvent(NetworkEvent networkEvent)
Deprecated.No-op implementation of theSpan.addNetworkEvent(NetworkEvent)method.- Overrides:
addNetworkEventin classSpan- Parameters:
networkEvent- the network event to add.
-
addMessageEvent
public void addMessageEvent(MessageEvent messageEvent)
No-op implementation of theSpan.addMessageEvent(MessageEvent)method.- Overrides:
addMessageEventin 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:SpanSets theStatusto theSpan.If used, this will override the default
Spanstatus. 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:
toStringin classjava.lang.Object
-
-