Package brave.context.slf4j
Class MDCScopeDecorator
- java.lang.Object
-
- brave.context.slf4j.MDCScopeDecorator
-
public final class MDCScopeDecorator extends Object
Creates aCorrelationScopeDecoratorfor SLF4J Mapped Diagnostic Context (MDC).Ex.
tracing = Tracing.newBuilder() .currentTraceContext(ThreadLocalCurrentTraceContext.newBuilder() .addScopeDecorator(MDCScopeDecorator.get()) .build() ) ... .build();- Since:
- 5.2
- See Also:
CorrelationScopeDecorator
-
-
Constructor Summary
Constructors Constructor Description MDCScopeDecorator()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CurrentTraceContext.ScopeDecoratorcreate()Deprecated.since 5.11 useget()ornewBuilder()static CurrentTraceContext.ScopeDecoratorget()Returns a singleton that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.static CorrelationScopeDecorator.BuildernewBuilder()Returns a builder that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.
-
-
-
Method Detail
-
get
public static CurrentTraceContext.ScopeDecorator get()
Returns a singleton that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.- Since:
- 5.11
-
newBuilder
public static CorrelationScopeDecorator.Builder newBuilder()
Returns a builder that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.- Since:
- 5.11
-
create
@Deprecated public static CurrentTraceContext.ScopeDecorator create()
Deprecated.since 5.11 useget()ornewBuilder()Returns a scope decorator that configuresBaggageFields.TRACE_ID,BaggageFields.PARENT_ID,BaggageFields.SPAN_IDandBaggageFields.SAMPLED- Since:
- 5.2
-
-