public static class NoOpSpanFactory.NoOpSpan extends Object implements Span
Span implementation that does nothing.| Modifier and Type | Field and Description |
|---|---|
static NoOpSpanFactory.NoOpSpan |
INSTANCE
Instance of a
NoOpSpanFactory.NoOpSpan that can be used to avoid creating new instances. |
| Constructor and Description |
|---|
NoOpSpan() |
| Modifier and Type | Method and Description |
|---|---|
Span |
addAttribute(String key,
String value)
Adds an attribute to the span.
|
void |
end()
Ends the span.
|
SpanScope |
makeCurrent()
Sets the Span as the current for the current thread.
|
Span |
recordException(Throwable t)
Records an exception to the span.
|
Span |
start()
Starts the Span.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrun, runCallable, runConsumer, runSupplier, wrapCallable, wrapConsumer, wrapRunnable, wrapSupplierpublic static final NoOpSpanFactory.NoOpSpan INSTANCE
NoOpSpanFactory.NoOpSpan that can be used to avoid creating new instances.public Span start()
SpanSpan.makeCurrent() in
order to do so.public SpanScope makeCurrent()
SpanSpanScope must be closed before ending
the Span, on the same thread, or through a try-with-resources statement in the same thread as this method was
called.
You can make a span current on as many threads as you like, but you have to close every SpanScope, or
context will leak into the current thread. Note that if this is neglected, the Span.end() method should warn
the user in order to report this back to the framework.
makeCurrent in interface Spanpublic void end()
SpanIf scopes are still open when this method is called, either an exception should be thrown or an error log should be produced to warn the user of the leak. This information can then be reported back to the developers of the framework for a fix.
public Span recordException(Throwable t)
SpanrecordException in interface Spant - The exception to recordpublic Span addAttribute(String key, String value)
SpanaddAttribute in interface Spankey - The key of the attribute.value - The value of the attribute.Copyright © 2010–2025. All rights reserved.