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?