Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn of presence of multiple APM Agents #3196

Open
lucabelluccini opened this issue Jun 20, 2023 · 2 comments
Open

Warn of presence of multiple APM Agents #3196

lucabelluccini opened this issue Jun 20, 2023 · 2 comments
Labels
agent-java community Issues and PRs created by the community

Comments

@lucabelluccini
Copy link
Contributor

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.

@github-actions github-actions bot added agent-java community Issues and PRs created by the community triage labels Jun 20, 2023
@jackshirazi
Copy link
Contributor

We can

  • detect classes loaded by the other agents for known agents (eg ElasticApmAgent class already looks for these to specifically avoid instrumenting them)
  • look at the command-line for other -javaagent and -agentlib
  • ?

@SylvainJuge
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-java community Issues and PRs created by the community
Projects
None yet
Development

No branches or pull requests

3 participants