Class OpenTelemetrySdkAccess
- java.lang.Object
-
- io.opentelemetry.javaagent.instrumentation.api.OpenTelemetrySdkAccess
-
public final class OpenTelemetrySdkAccess extends Object
A helper to facilitate accessing OpenTelemetry SDK methods from instrumentation. Because instrumentation runs in the app classloader, they do not have access to our SDK in the agent classloader. So we use this class in the bootstrap classloader to bridge between the two - the agent classloader will register implementations of needed SDK functions that can be called from instrumentation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceOpenTelemetrySdkAccess.ForceFlusherInterface matchingio.opentelemetry.sdk.trace.SdkTracerManagement#forceFlush()to allow holding a reference to it.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidforceFlush(int timeout, TimeUnit unit)Forces flush of pending spans and metrics.static voidinternalSetForceFlush(OpenTelemetrySdkAccess.ForceFlusher forceFlush)Sets theRunnableto execute when instrumentation needs to force flush.
-
-
-
Method Detail
-
forceFlush
public static void forceFlush(int timeout, TimeUnit unit)Forces flush of pending spans and metrics.
-
internalSetForceFlush
public static void internalSetForceFlush(OpenTelemetrySdkAccess.ForceFlusher forceFlush)
Sets theRunnableto execute when instrumentation needs to force flush. This is called from the agent classloader to execute the SDK's force flush mechanism. Instrumentation must not call this.
-
-