elastic / apm-agent-java

https://www.elastic.co/guide/en/apm/agent/java/current/index.html
Apache License 2.0
567 stars 321 forks source link

Make Attacher a formal installation method #638

Open eyalkoren opened 5 years ago

eyalkoren commented 5 years ago

Currently we regard it as experimental. This means at least adding it to tests.

Programmatic attach: Add to documentation that this is not the recommended way to go with application servers. This is more for standalone java apps where user has the control over the Main class. Also, provide a way to load configuration file from arbitrary paths (#701).

Remote attach: Add to all integration tests- copy into the container and add a command to attach right after app-server/servlet-container startup (#647).

felixbarny commented 5 years ago

We could also distribute a apm-agent-attach-all.jar file, which contains the JNA classes. This would allow attachment even if the tools.jar is not available. As JNA can't be shaded, we can't include it in the default distribution as it might conflict when using the programmatic attach. We should rather mark those dependencies as provided and document that those should be added to the application manually if needed.

However, there will still be scenarios in which the runtime attachment does not work. For example, when using minimal docker containers which don't ship with the programs which are required for the socket communication.

felixbarny commented 5 years ago

POC: https://github.com/felixbarny/apm-agent-java/tree/dispatcher

WebLogic 12.2.1.2 does also not work with runtime attachment