Class AgentInstaller


  • public class AgentInstaller
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.instrument.Instrumentation getInstrumentation()  
      static void installBytebuddyAgent​(java.lang.instrument.Instrumentation inst)  
      static net.bytebuddy.agent.builder.ResettableClassFileTransformer installBytebuddyAgent​(java.lang.instrument.Instrumentation inst, boolean skipAdditionalLibraryMatcher, java.lang.Iterable<io.opentelemetry.javaagent.spi.ComponentInstaller> componentInstallers, net.bytebuddy.agent.builder.AgentBuilder.Listener... listeners)
      Install the core bytebuddy agent along with all implementations of InstrumentationModule.
      static void registerClassLoadCallback​(java.lang.String className, java.lang.Runnable callback)
      Register a callback to run when a class is loading.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstrumentation

        public static java.lang.instrument.Instrumentation getInstrumentation()
      • installBytebuddyAgent

        public static void installBytebuddyAgent​(java.lang.instrument.Instrumentation inst)
      • installBytebuddyAgent

        public static net.bytebuddy.agent.builder.ResettableClassFileTransformer installBytebuddyAgent​(java.lang.instrument.Instrumentation inst,
                                                                                                       boolean skipAdditionalLibraryMatcher,
                                                                                                       java.lang.Iterable<io.opentelemetry.javaagent.spi.ComponentInstaller> componentInstallers,
                                                                                                       net.bytebuddy.agent.builder.AgentBuilder.Listener... listeners)
        Install the core bytebuddy agent along with all implementations of InstrumentationModule.
        Parameters:
        inst - Java Instrumentation used to install bytebuddy
        Returns:
        the agent's class transformer
      • registerClassLoadCallback

        public static void registerClassLoadCallback​(java.lang.String className,
                                                     java.lang.Runnable callback)
        Register a callback to run when a class is loading.

        Caveats:

        • This callback will be invoked by a jvm class transformer.
        • Classes filtered out by AgentInstaller's skip list will not be matched.
        Parameters:
        className - name of the class to match against
        callback - runnable to invoke when class name matches