Class AgentInitializer

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

public final class AgentInitializer extends Object
Agent start up logic.

This class is loaded and called by io.opentelemetry.javaagent.OpenTelemetryAgent

The intention is for this class to be loaded by bootstrap class loader to make sure we have unimpeded access to the rest of agent parts.

  • Method Details

    • initialize

      public static void initialize(Instrumentation inst, File javaagentFile, boolean fromPremain) throws Exception
      Throws:
      Exception
    • delayedStartHook

      public static void delayedStartHook() throws Exception
      Call to this method is inserted into sun.launcher.LauncherHelper.checkAndLoadMain().
      Throws:
      Exception
    • isAgentStarted

      public static boolean isAgentStarted(boolean vmStarted)
      Check whether agent has started or not along with VM.

      This method is used by io.opentelemetry.javaagent.tooling.AgentStarterImpl#InetAddressClassFileTransformer internally to check whether agent has started.

      Parameters:
      vmStarted - flag about whether VM has started or not.
      Returns:
      true if agent has started or not along with VM, false otherwise.
    • getExtensionsClassLoader

      public static ClassLoader getExtensionsClassLoader()