brave.Tracer#withSpanInScopepublic final class LocalSpanThreadBinder
extends java.lang.Object
To be used for async local call the result of which is processed in a separate callback
thread. After calling LocalTracer.startNewSpan(String, String), call getCurrentLocalSpan() and save the result to pass to the callback method (e.g., local final
variable) In the callback method, call setCurrentSpan(com.twitter.zipkin.gen.Span) before calling LocalTracer.finishSpan()
| Constructor | Description |
|---|---|
LocalSpanThreadBinder(LocalSpanState state) |
Deprecated.
Creates a new instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
Span |
getCurrentLocalSpan() |
Deprecated.
This should be called in the thread in which the local request made after starting new local
span.
|
void |
setCurrentSpan(Span span) |
Deprecated.
Binds given span to current thread.
|
public LocalSpanThreadBinder(LocalSpanState state)
state - local span state, cannot be nullpublic Span getCurrentLocalSpan()
It returns the current local span which you can keep and bind to the callback thread
setCurrentSpan(Span)public void setCurrentSpan(Span span)
LocalTracer.finishSpan()span - Span to bind to current execution thread. Cannot be null.Copyright © 2018 OpenZipkin. All rights reserved.