@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(com.google.instrumentation.trace.Span).
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 |
addAttributes(Map<String,AttributeValue> attributes)
No-op implementation of the
Span.addAttributes(Map) method. |
void |
addLink(Link link)
No-op implementation of the
Span.addLink(Link) method. |
void |
addNetworkEvent(NetworkEvent networkEvent)
No-op implementation of the
Span.addNetworkEvent(NetworkEvent) method. |
void |
end(EndSpanOptions options)
No-op implementation of the
Span.end(EndSpanOptions) method. |
String |
toString() |
addAnnotation, end, getContext, getOptionspublic static final BlankSpan INSTANCE
public void addAttributes(Map<String,AttributeValue> attributes)
Span.addAttributes(Map) method.addAttributes 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.addAttributes(java.util.Map<java.lang.String, com.google.instrumentation.trace.AttributeValue>).public void addAnnotation(Annotation annotation)
Span.addAnnotation(Annotation) method.addAnnotation in class Spanannotation - the annotations to add.public void addNetworkEvent(NetworkEvent networkEvent)
Span.addNetworkEvent(NetworkEvent) method.addNetworkEvent in class SpannetworkEvent - the network event to add.public void addLink(Link link)
Span.addLink(Link) method.public void end(EndSpanOptions options)
Span.end(EndSpanOptions) method.