Class DefaultInMemoryTracer
- java.lang.Object
-
- io.servicetalk.opentracing.inmemory.DefaultInMemoryTracer
-
- All Implemented Interfaces:
io.opentracing.Tracer
,InMemoryTracer
,java.io.Closeable
,java.lang.AutoCloseable
public final class DefaultInMemoryTracer extends java.lang.Object
Tracer implementation that propagates spans in-memory and emits events to listeners.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultInMemoryTracer.Builder
Builders forDefaultInMemoryTracer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.opentracing.Scope
activateSpan(io.opentracing.Span span)
InMemorySpan
activeSpan()
InMemorySpanBuilder
buildSpan(java.lang.String operationName)
void
close()
<C> InMemorySpanContext
extract(io.opentracing.propagation.Format<C> format, C carrier)
<C> void
inject(InMemorySpanContext spanContext, io.opentracing.propagation.Format<C> format, C carrier)
Same asInMemoryTracer.inject(SpanContext, Format, Object)
but requires aInMemorySpanContext
.protected InMemorySpanContext
newSpanContext(InMemoryTraceState state)
Create a span context with given trace state.InMemoryScopeManager
scopeManager()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.servicetalk.opentracing.inmemory.api.InMemoryTracer
inject
-
-
-
-
Method Detail
-
scopeManager
public InMemoryScopeManager scopeManager()
-
activeSpan
@Nullable public InMemorySpan activeSpan()
-
activateSpan
public io.opentracing.Scope activateSpan(io.opentracing.Span span)
-
buildSpan
public InMemorySpanBuilder buildSpan(java.lang.String operationName)
-
close
public void close()
-
newSpanContext
protected InMemorySpanContext newSpanContext(InMemoryTraceState state)
Create a span context with given trace state. Called when extracting from carriers.- Parameters:
state
- The state for the trace.- Returns:
- span context
-
inject
public final <C> void inject(InMemorySpanContext spanContext, io.opentracing.propagation.Format<C> format, C carrier)
Description copied from interface:InMemoryTracer
Same asInMemoryTracer.inject(SpanContext, Format, Object)
but requires aInMemorySpanContext
.- Specified by:
inject
in interfaceInMemoryTracer
- Type Parameters:
C
- The type of carrier.- Parameters:
spanContext
- TheInMemorySpanContext
to inject intocarrier
.format
- The format to in which to inject intocarrier
.carrier
- The carrier to be injected into.
-
extract
@Nullable public final <C> InMemorySpanContext extract(io.opentracing.propagation.Format<C> format, C carrier)
- Specified by:
extract
in interfaceInMemoryTracer
- Specified by:
extract
in interfaceio.opentracing.Tracer
-
-