public interface ScopeManager
ScopeManager
interface abstracts both the activation of Span
instances via
activate(Span, boolean)
and access to an active Span
/Scope
via active()
.Scope
,
Tracer.scopeManager()
Modifier and Type | Method and Description |
---|---|
Scope |
activate(Span span,
boolean finishSpanOnClose)
Make a
Span instance active. |
Scope |
active()
Return the currently active
Scope which can be used to access the currently active
Scope.span() . |
Scope activate(Span span, boolean finishSpanOnClose)
Span
instance active.span
- the Span
that should become the active()
finishSpanOnClose
- whether span should automatically be finished when Scope.close()
is calledScope
instance to control the end of the active period for the Span
. It is a
programming error to neglect to call Scope.close()
on the returned instance.Scope active()
Scope
which can be used to access the currently active
Scope.span()
.
If there is an non-null scope
, its wrapped Span
becomes an implicit parent
(as References.CHILD_OF
reference) of any
newly-created Span
at Tracer.SpanBuilder.startActive(boolean)
or Tracer.SpanBuilder.start()
time rather than at Tracer.buildSpan(String)
time.
active scope
, or null if none could be found.Copyright © 2016–2017 OpenTracing. All rights reserved.