Class 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.
    • Method Detail

      • 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 classloader to execute the SDK's force flush mechanism. Instrumentation must not call this.