public interface TraceScope extends Closeable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TraceScope.Continuation
Used to pass async context between workers.
|
| Modifier and Type | Method and Description |
|---|---|
TraceScope.Continuation |
capture()
Prevent the trace attached to this TraceScope from reporting until the returned Continuation is
either activated (and the returned scope is closed), or canceled.
|
TraceScope.Continuation |
captureConcurrent()
Prevent the trace attached to this TraceScope from reporting until the returned Continuation is
either activated (and the returned scope is closed), or canceled.
|
void |
close()
Close the activated context and allow any underlying spans to finish.
|
default boolean |
isAsyncPropagating()
Deprecated.
Replaced by
Tracer.isAsyncPropagationEnabled().
Calling this method will check whether asynchronous propagation is active for the active scope, not this scope instance. |
default void |
setAsyncPropagation(boolean value)
Deprecated.
Replaced by
Tracer.setAsyncPropagationEnabled(boolean)}.
Calling this method will enable or disable asynchronous propagation for the active scope, not this scope instance. |
TraceScope.Continuation capture()
Should be called on the parent thread.
TraceScope.Continuation captureConcurrent()
Should be called on the parent thread.
If the returned TraceScope.Continuation is activated, it needs to be canceled in addition to
the returned TraceScope being closed. This is to allow multiple concurrent threads that
activate the continuation to race in a safe way, and close the scopes without fear of closing
the related Span prematurely.
void close()
close in interface AutoCloseableclose in interface Closeable@Deprecated default boolean isAsyncPropagating()
Tracer.isAsyncPropagationEnabled().
Calling this method will check whether asynchronous propagation is active for the active scope, not this scope instance.
true if asynchronous propagation is enabled for the active
scope, false otherwise.@Deprecated default void setAsyncPropagation(boolean value)
Tracer.setAsyncPropagationEnabled(boolean)}.
Calling this method will enable or disable asynchronous propagation for the active scope, not this scope instance.
value - @true to enable asynchronous propagation, false to disable it.