Class ElasticApmAttacher


  • public class ElasticApmAttacher
    extends java.lang.Object
    Attaches the Elastic Apm agent to the current or a remote JVM
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void attach()
      Attaches the Elastic Apm agent to the current JVM.
      static void attach​(java.lang.String propertiesLocation)
      Attaches the Elastic Apm agent to the current JVM.
      static void attach​(java.lang.String pid, java.lang.String agentArgs)
      Deprecated.
      static void attach​(java.lang.String pid, java.util.Map<java.lang.String,​java.lang.String> configuration)
      Attaches the agent to a remote JVM
      static void attach​(java.lang.String pid, java.util.Map<java.lang.String,​java.lang.String> configuration, java.io.File agentJarFile)
      Attaches the agent to a remote JVM
      static void attach​(java.util.Map<java.lang.String,​java.lang.String> configuration)
      Attaches the Elastic Apm agent to the current JVM.
      static java.io.File getBundledAgentJarFile()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ElasticApmAttacher

        public ElasticApmAttacher()
    • Method Detail

      • attach

        public static void attach()
        Attaches the Elastic Apm agent to the current JVM.

        This method may only be invoked once.

        Tries to load elasticapm.properties from the classpath, if exists.

        Throws:
        java.lang.IllegalStateException - if there was a problem while attaching the agent to this VM
      • attach

        public static void attach​(java.lang.String propertiesLocation)
        Attaches the Elastic Apm agent to the current JVM.

        This method may only be invoked once.

        Parameters:
        propertiesLocation - the location within the classpath which contains the agent configuration properties file
        Throws:
        java.lang.IllegalStateException - if there was a problem while attaching the agent to this VM
        Since:
        1.11.0
      • attach

        public static void attach​(java.util.Map<java.lang.String,​java.lang.String> configuration)
        Attaches the Elastic Apm agent to the current JVM.

        This method may only be invoked once.

        Parameters:
        configuration - the agent configuration
        Throws:
        java.lang.IllegalStateException - if there was a problem while attaching the agent to this VM
      • attach

        public static void attach​(java.lang.String pid,
                                  java.util.Map<java.lang.String,​java.lang.String> configuration)
        Attaches the agent to a remote JVM
        Parameters:
        pid - the PID of the JVM the agent should be attached on
        configuration - the agent configuration
      • attach

        public static void attach​(java.lang.String pid,
                                  java.util.Map<java.lang.String,​java.lang.String> configuration,
                                  java.io.File agentJarFile)
        Attaches the agent to a remote JVM
        Parameters:
        pid - the PID of the JVM the agent should be attached on
        configuration - the agent configuration
        agentJarFile - the agent jar file
      • attach

        @Deprecated
        public static void attach​(java.lang.String pid,
                                  java.lang.String agentArgs)
        Deprecated.
        Attaches the agent to a remote JVM
        Parameters:
        pid - the PID of the JVM the agent should be attached on
        agentArgs - the agent arguments
      • getBundledAgentJarFile

        public static java.io.File getBundledAgentJarFile()