- java.lang.Object
-
- brave.internal.propagation.CorrelationFieldScopeDecorator
-
- brave.context.log4j2.ThreadContextScopeDecorator
-
- All Implemented Interfaces:
CurrentTraceContext.ScopeDecorator
public final class ThreadContextScopeDecorator extends CorrelationFieldScopeDecorator
Adds ThreadContext properties "traceId", "parentId", "spanId" and "sampled" when aspan is current. "traceId" and "spanId" are used in log correlation. "parentId" is used for scenarios such as log parsing that reconstructs the trace tree. "sampled" is used as a hint that a span found in logs might be in Zipkin.Ex.
tracing = Tracing.newBuilder() .currentTraceContext(ThreadLocalCurrentTraceContext.newBuilder() .addScopeDecorator(ThreadContextScopeDecorator.create()) .build() ) ... .build();
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CurrentTraceContext.ScopeDecoratorcreate()protected java.lang.Stringget(java.lang.String key)protected voidput(java.lang.String key, java.lang.String value)protected voidremove(java.lang.String key)-
Methods inherited from class brave.internal.propagation.CorrelationFieldScopeDecorator
decorateScope
-
-
-
-
Method Detail
-
create
public static CurrentTraceContext.ScopeDecorator create()
-
get
protected java.lang.String get(java.lang.String key)
- Specified by:
getin classCorrelationFieldScopeDecorator
-
put
protected void put(java.lang.String key, java.lang.String value)- Specified by:
putin classCorrelationFieldScopeDecorator
-
remove
protected void remove(java.lang.String key)
- Specified by:
removein classCorrelationFieldScopeDecorator
-
-