Class OpenTelemetrySdkAccess

java.lang.Object
io.opentelemetry.javaagent.bootstrap.OpenTelemetrySdkAccess

public final class OpenTelemetrySdkAccess extends Object
A helper to facilitate accessing OpenTelemetry SDK methods from instrumentation. Because instrumentation runs in the app class loader, they do not have access to our SDK in the agent class loader. So we use this class in the bootstrap class loader to bridge between the two - the agent class loader will register implementations of needed SDK functions that can be called from instrumentation.
  • Method Details

    • forceFlush

      public static void forceFlush(int timeout, TimeUnit unit)
      Forces flushing of pending spans.
    • internalSetForceFlush

      public static void internalSetForceFlush(OpenTelemetrySdkAccess.ForceFlusher forceFlush)
      Sets the Runnable to execute when instrumentation needs to force flush. This is called from the agent class loader to execute the SDK's force flush mechanism. Instrumentation must not call this.