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)
TracerContext
startSpan
in interface TracerContext
description
- span descriptionpublic <T> T continueSpan(Traceable<T> traceable) throws Exception
TracerContext
continueSpan
in interface TracerContext
traceable
- traceable implementation to be executedException
- any exception being thrown by the traceable implementationpublic <T> Callable<T> wrap(String description, Traceable<T> traceable)
TracerContext
wrap
in interface TracerContext
description
- span descriptiontraceable
- traceable implementation to be wrappedpublic void annotate(String key, String value)
TracerContext
annotate
in interface TracerContext
key
- key to addvalue
- value to addpublic void timeline(String message)
TracerContext
timeline
in interface TracerContext
message
- timeline messagepublic <T> T unwrap(Class<T> clazz)
TracerContext
unwrap
in interface TracerContext
clazz
- - the class of the object to be returned.Apache CXF