Package brave.propagation
Interface CurrentTraceContext.ScopeDecorator
- All Known Implementing Classes:
CorrelationScopeDecorator
,StrictScopeDecorator
- Enclosing class:
- CurrentTraceContext
public static interface CurrentTraceContext.ScopeDecorator
Use 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)
or
CurrentTraceContext.maybeScope(TraceContext)
, many tools use these underneath. For example, Tracer.startScopedSpan(String)
and Tracer.withSpanInScope(brave.Span)
set
a span in scope. An executor wrapped with CurrentTraceContext.executor(Executor)
would decorate each
runnable.
- Since:
- 5.2
-
Field Summary
Fields Modifier and Type Field Description static CurrentTraceContext.ScopeDecorator
NOOP
Use this when configuration results in no decoration needed. -
Method Summary
Modifier and Type Method Description CurrentTraceContext.Scope
decorateScope(TraceContext context, CurrentTraceContext.Scope scope)
-
Field Details
-
NOOP
Use this when configuration results in no decoration needed.- Since:
- 5.11
-
-
Method Details
-
decorateScope
CurrentTraceContext.Scope decorateScope(@Nullable TraceContext context, CurrentTraceContext.Scope scope)- Parameters:
context
- null implies the scope should be clearedscope
-CurrentTraceContext.Scope.NOOP
if the former decoration resulted in no change.
-