Tracer.HeaderAccessor, Tracer.HeaderMutator| Constructor and Description |
|---|
TracerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeCurrentSpan()
Finish the current span and restore the current span's parent as the current span
|
void |
closeSpan(SpanBuilder current)
Finish the supplied span and restore the supplied span's parent as the current span.
|
SpanBuilder |
createSpan()
Create a span which is a child of the current span.
|
<T> T |
executeCallable(String resource,
String operation,
Callable<T> callable)
Execute a Callable with reporting
|
void |
executeRunnable(String resource,
String operation,
Runnable runnable)
Execute a Runnable with reporting
|
SpanBuilder.SpanContext |
exportCurrentSpan()
Export a span across a thread.
|
void |
exportSpan(String resource,
String operation,
Tracer.HeaderMutator headerAccessor)
Export a span to another process using headers.
|
SpanBuilder |
getCurrentSpan()
Get the currently active span
|
SpanBuilder |
importCurrentSpan(SpanBuilder.SpanContext spanContext,
String resource,
String operation)
Import a span across a thread.
|
SpanBuilder |
importSpan(Tracer.HeaderAccessor headerAccessor)
Import a span across process boundaries using a set of headers.
|
public <T> T executeCallable(String resource, String operation, Callable<T> callable)
executeCallable in interface TracerT - The return type of the Callableresource - The resource being calledoperation - The operation being calledcallable - The Callable to invokepublic void executeRunnable(String resource, String operation, Runnable runnable)
executeRunnable in interface Tracerresource - The resource being calledoperation - The operation being calledrunnable - The runnable to invokepublic SpanBuilder getCurrentSpan()
getCurrentSpan in interface Tracerpublic SpanBuilder.SpanContext exportCurrentSpan()
TracerexportCurrentSpan in interface Tracerpublic SpanBuilder importCurrentSpan(SpanBuilder.SpanContext spanContext, String resource, String operation)
TracerTracer.getCurrentSpan() must be called from the exporting Thread.
WARNING: Importing a thread will destroy the current threads stack of spans!importCurrentSpan in interface TracerspanContext - A SpanContext from Tracer.exportCurrentSpan()resource - The resource for the new spanoperation - The operation for the new spanpublic SpanBuilder importSpan(Tracer.HeaderAccessor headerAccessor)
importSpan in interface TracerheaderAccessor - The function access to headers. Function supplied with header name and
should return the header value.public void exportSpan(String resource, String operation, Tracer.HeaderMutator headerAccessor)
exportSpan in interface Tracerresource - The remote resource being invokedoperation - The remote operation being invokedheaderAccessor - The function access to headers. Function supplied with header name and
value.public SpanBuilder createSpan()
createSpan in interface Tracerpublic void closeCurrentSpan()
closeCurrentSpan in interface Tracerpublic void closeSpan(SpanBuilder current)
Copyright © 2017–2019. All rights reserved.