Hi Team,
I believe provision for detaching java agent from the process without restarting is quite critical. This will be one of the key feature asked during go live. I see that changing the value for "elastic.apm.active" to false dynamically can stop the instrumentation, however the object pools and other threads will remain in the JVM.
One of the option could to call "ElasticApmInstrumentation.tracer.stop()" from JMX or somewhere. Though this stops most of the APM related threads and unloads the instrumentation I still see apm-reporter thread running.
Would this be the right approach to detach the agent?
If we just use elastic.apm.active=false, no matter how long we wait threads apm-reporter, apm-request-timeout-timer, configuration-reloader, apm-metrics-reporter will still be running. The only way to stop these threads is using stop method.
Please refer the Other Thread to know why I want all threads to be closed, issue with active flag and what are the actions I am taking to dettach the agent.
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.