@Immutable public final class BlankSpan extends Span
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).
Span.Kind, Span.Options| Modifier and Type | Field and Description |
|---|---|
static BlankSpan |
INSTANCE
Singleton instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotation(Annotation annotation)
No-op implementation of the
Span.addAnnotation(Annotation) method. |
void |
addAnnotation(String description,
Map<String,AttributeValue> attributes)
No-op implementation of the
Span.addAnnotation(String, Map) method. |
void |
addLink(Link link)
No-op implementation of the
Span.addLink(Link) method. |
void |
addMessageEvent(MessageEvent messageEvent)
No-op implementation of the
Span.addMessageEvent(MessageEvent) method. |
void |
addNetworkEvent(NetworkEvent networkEvent)
Deprecated.
|
void |
end(EndSpanOptions options)
No-op implementation of the
Span.end(EndSpanOptions) method. |
void |
putAttribute(String key,
AttributeValue value)
No-op implementation of the
Span.putAttribute(String, AttributeValue) method. |
void |
putAttributes(Map<String,AttributeValue> attributes)
No-op implementation of the
Span.putAttributes(Map) method. |
void |
setStatus(Status status)
Sets the
Status to the Span. |
String |
toString() |
addAnnotation, addAttributes, end, getContext, getOptionspublic static final BlankSpan INSTANCE
public void putAttribute(String key, AttributeValue value)
Span.putAttribute(String, AttributeValue) method.putAttribute in class Spankey - the key for this attribute.value - the value for this attribute.public void putAttributes(Map<String,AttributeValue> attributes)
Span.putAttributes(Map) method.putAttributes in class Spanattributes - the attributes that will be added and associated with the Span.public void addAnnotation(String description, Map<String,AttributeValue> attributes)
Span.addAnnotation(String, Map) method.addAnnotation in class Spandescription - the description of the annotation time event.attributes - the attributes that will be added; these are associated with this annotation,
not the Span as for Span.putAttributes(Map).public void addAnnotation(Annotation annotation)
Span.addAnnotation(Annotation) method.addAnnotation in class Spanannotation - the annotations to add.@Deprecated public void addNetworkEvent(NetworkEvent networkEvent)
Span.addNetworkEvent(NetworkEvent) method.addNetworkEvent in class SpannetworkEvent - the network event to add.public void addMessageEvent(MessageEvent messageEvent)
Span.addMessageEvent(MessageEvent) method.addMessageEvent in class SpanmessageEvent - the message to add.public void addLink(Link link)
Span.addLink(Link) method.public void setStatus(Status status)
SpanStatus to the Span.
If used, this will override the default Span status. Default is Status.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.
public void end(EndSpanOptions options)
Span.end(EndSpanOptions) method.