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();