public class OpenTracingContext extends Object implements TracerContext
| Constructor and Description |
|---|
OpenTracingContext(io.opentracing.Tracer tracer) |
OpenTracingContext(io.opentracing.Tracer tracer,
io.opentracing.Span continuation) |
| Modifier and Type | Method and Description |
|---|---|
void |
annotate(String key,
String value)
Adds a key/value pair to the currently active span.
|
<T> T |
continueSpan(Traceable<T> traceable)
Picks up an currently detached span from another thread.
|
io.opentracing.Scope |
startSpan(String description)
Starts a new span in the current thread.
|
void |
timeline(String message)
Adds a timeline to the currently active span.
|
<T> T |
unwrap(Class<T> clazz)
Returns an object of the specified type to allow access to the specific API
of the tracing provider.
|
<T> Callable<T> |
wrap(String description,
Traceable<T> traceable)
Wraps the traceable into a new span, preserving the current span as a parent.
|
public OpenTracingContext(io.opentracing.Tracer tracer)
public OpenTracingContext(io.opentracing.Tracer tracer,
io.opentracing.Span continuation)
public io.opentracing.Scope startSpan(String description)
TracerContextstartSpan in interface TracerContextdescription - span descriptionpublic <T> T continueSpan(Traceable<T> traceable) throws Exception
TracerContextcontinueSpan in interface TracerContexttraceable - traceable implementation to be executedException - any exception being thrown by the traceable implementationpublic <T> Callable<T> wrap(String description, Traceable<T> traceable)
TracerContextwrap in interface TracerContextdescription - span descriptiontraceable - traceable implementation to be wrappedpublic void annotate(String key, String value)
TracerContextannotate in interface TracerContextkey - key to addvalue - value to addpublic void timeline(String message)
TracerContexttimeline in interface TracerContextmessage - timeline messagepublic <T> T unwrap(Class<T> clazz)
TracerContextunwrap in interface TracerContextclazz - - the class of the object to be returned.Apache CXF