Package brave.context.slf4j
Class MDCScopeDecorator
java.lang.Object
brave.context.slf4j.MDCScopeDecorator
public final class MDCScopeDecorator extends Object
Creates a
CorrelationScopeDecorator 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
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.
-
Constructor Details
-
MDCScopeDecorator
public MDCScopeDecorator()
-
-
Method Details
-
get
Returns a singleton that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.- Since:
- 5.11
-
newBuilder
Returns a builder that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.- Since:
- 5.11
-
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
-