Package brave.propagation
Class StrictScopeDecorator
java.lang.Object
brave.propagation.StrictScopeDecorator
- All Implemented Interfaces:
CurrentTraceContext.ScopeDecorator
public final class StrictScopeDecorator extends Object implements CurrentTraceContext.ScopeDecorator
Useful when developing instrumentation as state is enforced more strictly.
Ex.
tracing = Tracing.newBuilder()
.spanReporter(...)
.currentTraceContext(ThreadLocalCurrentTraceContext.newBuilder()
.addScopeDecorator(StrictScopeDecorator.create())
.build()
).build();
-
Method Summary
Modifier and Type Method Description static CurrentTraceContext.ScopeDecorator
create()
CurrentTraceContext.Scope
decorateScope(TraceContext currentSpan, CurrentTraceContext.Scope scope)
Identifies problems by throwing assertion errors when a scope is closed on a different thread.
-
Method Details
-
create
-
decorateScope
public CurrentTraceContext.Scope decorateScope(@Nullable TraceContext currentSpan, CurrentTraceContext.Scope scope)Identifies problems by throwing assertion errors when a scope is closed on a different thread.- Specified by:
decorateScope
in interfaceCurrentTraceContext.ScopeDecorator
-