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.ObjectTracer implementation that propagates spans in-memory and emits events to listeners.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultInMemoryTracer.BuilderBuilders forDefaultInMemoryTracer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.opentracing.ScopeactivateSpan(io.opentracing.Span span)InMemorySpanactiveSpan()InMemorySpanBuilderbuildSpan(java.lang.String operationName)voidclose()<C> InMemorySpanContextextract(io.opentracing.propagation.Format<C> format, C carrier)<C> voidinject(InMemorySpanContext spanContext, io.opentracing.propagation.Format<C> format, C carrier)Same asInMemoryTracer.inject(SpanContext, Format, Object)but requires aInMemorySpanContext.protected InMemorySpanContextnewSpanContext(InMemoryTraceState state)Create a span context with given trace state.InMemoryScopeManagerscopeManager()-
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:InMemoryTracerSame asInMemoryTracer.inject(SpanContext, Format, Object)but requires aInMemorySpanContext.- Specified by:
injectin interfaceInMemoryTracer- Type Parameters:
C- The type of carrier.- Parameters:
spanContext- TheInMemorySpanContextto 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:
extractin interfaceInMemoryTracer- Specified by:
extractin interfaceio.opentracing.Tracer
-
-