elastic / apm-agent-java

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

Warn of presence of multiple APM Agents #3196

Open lucabelluccini opened 1 year ago

lucabelluccini commented 1 year ago

Is your feature request related to a problem?

We are aware multiple APM Agents might conflict each other https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html#trouble-shooting-additional-agent We need to detect it as soon as possible.

Describe the solution you'd like

Attempt to detect if other "agents" are running together with Elastic APM Agent and log a warning at startup of the application.

Describe alternatives you've considered

Alternative is to check this manually and it might be easily overlooked.

jackshirazi commented 1 year ago

We can

SylvainJuge commented 1 year ago

I think this is definitely a great idea, but it could be trickly to implement properly.

Parsing -javaagent could produce false positives as some application servers are shipped with an agent by default.

Adding an heuristic to detect other agents would be doable, but would likely require to implement and maintain a "list of known agents", trying to open other -javaagent jar files and detect on the META-INF/MANIFEST.MF entries could be a good start.