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.
|
boolean |
isAsyncPropagating()
If true, this context will propagate across async boundaries.
|
void |
setAsyncPropagation(boolean value)
Enable or disable async propagation.
|
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 Closeableboolean isAsyncPropagating()
void setAsyncPropagation(boolean value)
value - The new propagation value. True == propagate. False == don't propagate.