public interface Scope extends Closeable
Scope formalizes the activation and deactivation of a Span, usually from a CPU standpoint.
Many times a Span will be extant (in that Span.finish() has not been called) despite being in a
non-runnable state from a CPU/scheduler standpoint. For instance, a Span representing the client side of an
RPC will be unfinished but blocked on IO while the RPC is still outstanding. A Scope defines when a given
Span is scheduled and on the path.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Mark the end of the active period for the current context (usually a thread)
and
Scope, updating ScopeManager.active() and ScopeManager.activeSpan()
in the process. |
Span |
span()
Deprecated.
use
Span directly or access it through ScopeManager.activeSpan()
Return the corresponding active Span for this instance. |
void close()
Scope, updating ScopeManager.active() and ScopeManager.activeSpan()
in the process.
NOTE: Calling close() more than once on a single Scope instance leads to undefined
behavior.
close in interface AutoCloseableclose in interface Closeable@Deprecated Span span()
Span directly or access it through ScopeManager.activeSpan()
Return the corresponding active Span for this instance.Copyright © 2016–2019 OpenTracing. All rights reserved.