public class ThreadLocalActiveSpanSource extends Object implements ActiveSpanSource
ActiveSpanSource implementation built on top of Java's thread-local storage primitive.| Constructor and Description |
|---|
ThreadLocalActiveSpanSource() |
| Modifier and Type | Method and Description |
|---|---|
ThreadLocalActiveSpan |
activeSpan()
Return the
active span. |
ActiveSpan |
makeActive(Span span)
Wrap and "make active" a
Span by encapsulating it – and any active state (e.g., MDC state) in the
current thread – in a new ActiveSpan. |
public ThreadLocalActiveSpan activeSpan()
ActiveSpanSourceactive span. This does not affect the internal reference count for the
ActiveSpan.
If there is an active span, it becomes an implicit parent of any newly-created
span at Tracer.SpanBuilder.startActive() time (rather than at
Tracer.buildSpan(String) time).
activeSpan in interface ActiveSpanSourceactive span, or null if none could be found.public ActiveSpan makeActive(Span span)
ActiveSpanSourceSpan by encapsulating it – and any active state (e.g., MDC state) in the
current thread – in a new ActiveSpan.makeActive in interface ActiveSpanSourcespan - the Span to wrap in an ActiveSpanActiveSpan that encapsulates the given Span and any other
ActiveSpanSource-specific context (e.g., the MDC context map)Copyright © 2016–2018 OpenTracing. All rights reserved.