Class B3KeyValueFormatter<T>
java.lang.Object
io.servicetalk.opentracing.inmemory.B3KeyValueFormatter<T>
- All Implemented Interfaces:
io.opentracing.propagation.Format<T>
,InMemorySpanContextExtractor<T>
,InMemorySpanContextFormat<T>
,InMemorySpanContextInjector<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.opentracing.propagation.Format
io.opentracing.propagation.Format.Builtin<C extends Object>
-
Constructor Summary
ConstructorsConstructorDescriptionB3KeyValueFormatter
(TriConsumer<T, CharSequence, CharSequence> carrierInjector, BiFunction<T, CharSequence, CharSequence> carrierExtractor, boolean verifyExtractedValues) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionExtract the trace state from a carrier.void
inject
(InMemorySpanContext context, T carrier) Inject a trace state into a carrier.
-
Constructor Details
-
B3KeyValueFormatter
public B3KeyValueFormatter(TriConsumer<T, CharSequence, CharSequence> carrierInjector, BiFunction<T, CharSequence, CharSequence> carrierExtractor, boolean verifyExtractedValues) Create a new instance.- Parameters:
carrierInjector
- ATriConsumer
used to inject entries to a Key-Value carrier.carrierExtractor
- ABiFunction
used to extract to extract values from a Key-Value carrier.verifyExtractedValues
-true
to make a best effort verification that the extracted values are of the correct format.
-
-
Method Details
-
inject
Description copied from interface:InMemorySpanContextInjector
Inject a trace state into a carrier.- Specified by:
inject
in interfaceInMemorySpanContextInjector<T>
- Parameters:
context
- span contextcarrier
- carrier to inject into
-
extract
Description copied from interface:InMemorySpanContextExtractor
Extract the trace state from a carrier.- Specified by:
extract
in interfaceInMemorySpanContextExtractor<T>
- Parameters:
carrier
- carrier to extract from- Returns:
- extracted
InMemorySpanContext
, may benull
if the carrier doesn't contain a valid span
-