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

jmx-metrics-fix #3713

Closed SylvainJuge closed 3 months ago

SylvainJuge commented 4 months ago

What does this PR do?

When registering JMX with a wildcard, getting an MBeanRuntimeException is managed and allows to consider the metric attribute as having a transient error.

However this is not the case when not using wildcards, which makes it fail for example when the implementation throws an MbeanRuntimeException with NullPointerException as cause.

This PR just applies the same heuristics for both cases with a minor refactor to prevent this from happening in the future.

Checklist