We are capturing the application metrics with elastic APM agent using apm-agent-attach-cli.jar which attaches to the running JVM's without making any changes to the code or JVM startup.
This is working fine without any issues and metrics are visible on UI.
however we cannot detach apm-agent-attach-cli.jar from running JVM unless we restart the JVM Process.
Could you share how this can be tackled through apm-agent-attach-cli.jar.
Hi Jonas, Getting the configurations from properties file, APM agent is still pushing metrics to APM server. Is there anything else we need to look at to stop the metrics from being sent to APM server? We also tried disable_send to true and Instrument to false
Thank you Jonas for the reply. I made the changes you suggested, below you should see the poperties and script we used. Still getting trace metrics to APM server.
Output after the script ran:
The tracer said paused but we are still seeing the transactions coming into Kibana APM. Since the agent is already attached it is throwing an Error. but eventually when I left the process running for 1 hour it eventually said tracer paused. Highled in the screenshot below.
If I understand you correctly, you are running the attacher again, in order to make the agent "stop". This won't work and rather cause harm, because you'll have two agents running in parallel on the same process.
You instead should do the following:
When attaching the agent for the first time to the process, provide the --config config_file="/apm-agent-attach/elasticapm.properties" option
The properties file should contain recording=true
When you now want to disable the agent, simply edit the config file to recording=false. The agent will reload the configuration after at most 30 seconds and disable itself. You can reenable it by editing the config file back to recording = true
When we tried on a new server it started working. The servers where the agent was already running, it did not work. Maybe we need to restart the applications to take effect.
Question, When I run "java -jar ...." The agent is starting but after a while I have to do ctl+c to kill the process. Since it keeps going. Is this normal? If we want to automate the installation process using Ansible, should we install it in a different way?
Also one more, even after we kill the apm process the metrics are still coming in. How does the agent still keep working after killing the apm process?
When we tried on a new server it started working. The servers where the agent was already running, it did not work. Maybe we need to restart the applications to take effect.
As I already said, you must not run the agent twice on the same process!
Question, When I run "java -jar ...." The agent is starting but after a while I have to do ctl+c to kill the process. Since it keeps going. Is this normal? If we want to automate the installation process using Ansible, should we install it in a different way?
Do you mean you start your application via "java -jar ...." or the agent attacher?
Also one more, even after we kill the apm process the metrics are still coming in. How does the agent still keep working after killing the apm process?
There is no separate "apm-process". The attacher forces your application-JVM to load and start the apm agent. The attacher process itself doesn't send any data.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.