Package brave.context.jfr
Class JfrScopeDecorator
java.lang.Object
brave.context.jfr.JfrScopeDecorator
- All Implemented Interfaces:
CurrentTraceContext.ScopeDecorator
public final class JfrScopeDecorator extends java.lang.Object implements CurrentTraceContext.ScopeDecorator
Adds Event properties "traceId", "parentId" and "spanId" when a
span is current. These can be used to correlate JDK Flight recorder
events with logs or Zipkin.
Ex.
tracing = Tracing.newBuilder()
.currentTraceContext(ThreadLocalCurrentTraceContext.newBuilder()
.addScopeDecorator(JfrScopeDecorator.get())
.build()
)
...
.build();
-
Field Summary
-
Method Summary
Modifier and Type Method Description static CurrentTraceContext.ScopeDecoratorcreate()Deprecated.since 5.11 useget()CurrentTraceContext.ScopedecorateScope(TraceContext context, CurrentTraceContext.Scope scope)static CurrentTraceContext.ScopeDecoratorget()Returns a singleton that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.
-
Method Details
-
get
Returns a singleton that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.- Since:
- 5.11
-
create
Deprecated.since 5.11 useget() -
decorateScope
public CurrentTraceContext.Scope decorateScope(@Nullable TraceContext context, CurrentTraceContext.Scope scope)- Specified by:
decorateScopein interfaceCurrentTraceContext.ScopeDecorator
-