Package brave.propagation
Interface CurrentTraceContext.ScopeDecorator
-
- All Known Implementing Classes:
CorrelationScopeDecorator,StrictScopeDecorator
- Enclosing class:
- CurrentTraceContext
public static interface CurrentTraceContext.ScopeDecoratorUse this to add features such as thread checks or log correlation when a scope is created or closed.While decoration technically occurs with
CurrentTraceContext.newScope(TraceContext)orCurrentTraceContext.maybeScope(TraceContext), many tools use these underneath. For example,Tracer.startScopedSpan(String)andTracer.withSpanInScope(brave.Span)set a span in scope. An executor wrapped withCurrentTraceContext.executor(Executor)would decorate each runnable.- Since:
- 5.2
-
-
Field Summary
Fields Modifier and Type Field Description static CurrentTraceContext.ScopeDecoratorNOOPUse this when configuration results in no decoration needed.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CurrentTraceContext.ScopedecorateScope(TraceContext context, CurrentTraceContext.Scope scope)
-
-
-
Field Detail
-
NOOP
static final CurrentTraceContext.ScopeDecorator NOOP
Use this when configuration results in no decoration needed.- Since:
- 5.11
-
-
Method Detail
-
decorateScope
CurrentTraceContext.Scope decorateScope(@Nullable TraceContext context, CurrentTraceContext.Scope scope)
- Parameters:
context- null implies the scope should be clearedscope-CurrentTraceContext.Scope.NOOPif the former decoration resulted in no change.
-
-