Package co.elastic.apm.attach
Class ElasticApmAttacher
- java.lang.Object
-
- co.elastic.apm.attach.ElasticApmAttacher
-
public class ElasticApmAttacher extends java.lang.ObjectAttaches the Elastic Apm agent to the current or a remote JVM
-
-
Constructor Summary
Constructors Constructor Description ElasticApmAttacher()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidattach()Attaches the Elastic Apm agent to the current JVM.static voidattach(java.lang.String propertiesLocation)Attaches the Elastic Apm agent to the current JVM.static voidattach(java.lang.String pid, java.lang.String agentArgs)Deprecated.static voidattach(java.lang.String pid, java.util.Map<java.lang.String,java.lang.String> configuration)Attaches the agent to a remote JVMstatic voidattach(java.lang.String pid, java.util.Map<java.lang.String,java.lang.String> configuration, java.io.File agentJarFile)Attaches the agent to a remote JVMstatic voidattach(java.util.Map<java.lang.String,java.lang.String> configuration)Attaches the Elastic Apm agent to the current JVM.static java.io.FilegetBundledAgentJarFile()
-
-
-
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.propertiesfrom 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 onconfiguration- 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 onconfiguration- the agent configurationagentJarFile- 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 onagentArgs- the agent arguments
-
getBundledAgentJarFile
public static java.io.File getBundledAgentJarFile()
-
-