public final class TraceHandler
extends java.lang.Object
TraceHandler provides methods for creating and manipulating trace spans from
instrumented bytecode.
TraceHandler avoids tight coupling with the concrete trace API through the TraceProvider interface.
Both TraceHandler and TraceProvider are loaded by the bootstrap classloader
so that they can be used from classes loaded by the bootstrap classloader. A concrete
implementation of TraceProvider will be loaded by the system classloader. This allows for
using the same trace API as the instrumented application.
TraceHandler is implemented as a static class to allow for easy and fast use from
instrumented bytecode. We cannot use dependency injection for the instrumented bytecode.
| Modifier and Type | Method and Description |
|---|---|
static void |
finishSpan(java.io.Closeable scope,
java.lang.Throwable throwable) |
static void |
setTraceProvider(TraceProvider traceProvider) |
static java.io.Closeable |
startSpan(java.lang.String spanName) |
public static void setTraceProvider(TraceProvider traceProvider)
public static java.io.Closeable startSpan(java.lang.String spanName)
public static void finishSpan(java.io.Closeable scope,
java.lang.Throwable throwable)