public interface ExtendedTracer
extends io.opentracing.Tracer
There are additional two methods for creating a SpanBuilder where user can choose if
current thread context should be referenced or not.
The tracer allows registration of the Propagator for a specific format. This method
allows overwriting of the tracer default propagators. Note that inspectIT tracer by default uses
TextMapPropagator for the
io.opentracing.propagation.Format.Builtin.TEXT_MAP and
UrlEncodingPropagator for
the io.opentracing.propagation.Format.Builtin.HTTP_HEADERS format.
| Modifier and Type | Method and Description |
|---|---|
io.opentracing.Tracer.SpanBuilder |
buildSpan()
Builds span with no operation name.
|
io.opentracing.Tracer.SpanBuilder |
buildSpan(java.lang.String operationName,
java.lang.String referenceType,
boolean useThreadContext)
Creates
SpanBuilder that optionally adds the reference to the current thread context
span. |
io.opentracing.SpanContext |
getCurrentContext()
Returns the current thread span context if one exists.
|
<C> void |
registerPropagator(io.opentracing.propagation.Format<C> format,
Propagator<C> propagator)
Registers propagator.
|
void |
setTimer(Timer timer)
Sets the implementation of the
Timer to use. |
<C> void registerPropagator(io.opentracing.propagation.Format<C> format,
Propagator<C> propagator)
TextMapPropagator for
the io.opentracing.propagation.Format.Builtin.TEXT_MAP and
UrlEncodingPropagator
for the io.opentracing.propagation.Format.Builtin.HTTP_HEADERS format.C - format typeformat - opentracing Formatpropagator - Propagatorvoid setTimer(Timer timer) throws java.lang.IllegalArgumentException
Timer to use.
By default inspectIT tracer uses
SystemTimer that has millisecond
start time precision. This done so inspectIT can be compatible with Java 6. Users can provide
better timers if they run on higher Java versions or have third party dependencies that could
do better.
timer - Timer to set. Must not be null.java.lang.IllegalArgumentException - If timer provided is null.io.opentracing.Tracer.SpanBuilder buildSpan()
SpanBuilder.io.opentracing.Tracer.SpanBuilder buildSpan(java.lang.String operationName,
java.lang.String referenceType,
boolean useThreadContext)
SpanBuilder that optionally adds the reference to the current thread context
span.operationName - Operation name of the span.referenceType - Reference type to the current context. Can be null if
useThreadContext=falseuseThreadContext - If thread context should be used.SpanBuilder.io.opentracing.SpanContext getCurrentContext()
null.
The noop tracer implementation should always return the
NoopSpanContext instance here.
null if thread has no such spans.