Package brave.context.slf4j
Class MDCScopeDecorator
- java.lang.Object
-
- brave.context.slf4j.MDCScopeDecorator
-
public final class MDCScopeDecorator extends Object
Creates aCorrelationScopeDecorator
for 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.ScopeDecorator
create()
Deprecated.since 5.11 useget()
ornewBuilder()
static CurrentTraceContext.ScopeDecorator
get()
Returns a singleton that configuresBaggageFields.TRACE_ID
andBaggageFields.SPAN_ID
.static CorrelationScopeDecorator.Builder
newBuilder()
Returns a builder that configuresBaggageFields.TRACE_ID
andBaggageFields.SPAN_ID
.
-
-
-
Method Detail
-
get
public static CurrentTraceContext.ScopeDecorator get()
Returns a singleton that configuresBaggageFields.TRACE_ID
andBaggageFields.SPAN_ID
.- Since:
- 5.11
-
newBuilder
public static CorrelationScopeDecorator.Builder newBuilder()
Returns a builder that configuresBaggageFields.TRACE_ID
andBaggageFields.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_ID
andBaggageFields.SAMPLED
- Since:
- 5.2
-
-