- java.lang.Object
-
- brave.internal.propagation.CorrelationFieldScopeDecorator
-
- All Implemented Interfaces:
CurrentTraceContext.ScopeDecorator
public abstract class CorrelationFieldScopeDecorator extends java.lang.Object implements CurrentTraceContext.ScopeDecorator
Adds correlation 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.
-
-
Constructor Summary
Constructors Constructor Description CorrelationFieldScopeDecorator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CurrentTraceContext.ScopedecorateScope(TraceContext currentSpan, CurrentTraceContext.Scope scope)When the input is not null "traceId", "parentId", "spanId" and "sampled" correlation properties are saved off and replaced with those of the current span.protected abstract java.lang.Stringget(java.lang.String key)Returns the correlation property of the specified name iff it is a string, or null otherwise.protected abstract voidput(java.lang.String key, java.lang.String value)Replaces the correlation property of the specified nameprotected abstract voidremove(java.lang.String key)Removes the correlation property of the specified name
-
-
-
Method Detail
-
decorateScope
public CurrentTraceContext.Scope decorateScope(@Nullable TraceContext currentSpan, CurrentTraceContext.Scope scope)
When the input is not null "traceId", "parentId", "spanId" and "sampled" correlation properties are saved off and replaced with those of the current span. When the input is null, these properties are removed. Either way, "traceId", "parentId", "spanId" and "sampled" properties are restored on CurrentTraceContext.Scope.close().- Specified by:
decorateScopein interfaceCurrentTraceContext.ScopeDecorator
-
get
@Nullable protected abstract java.lang.String get(java.lang.String key)
Returns the correlation property of the specified name iff it is a string, or null otherwise.
-
put
protected abstract void put(java.lang.String key, java.lang.String value)Replaces the correlation property of the specified name
-
remove
protected abstract void remove(java.lang.String key)
Removes the correlation property of the specified name
-
-