Add capture_jmx_metrics option#801
Conversation
- uses ObjectName syntax, leverages javax.management.ObjectName for parsing - allow multiple attribute[] elements - more tests, including negative tests - make MapsTokenScanner more resilient against IndexOutOfBoundsExceptions
Codecov Report
@@ Coverage Diff @@
## master #801 +/- ##
============================================
+ Coverage 63.51% 64.23% +0.71%
Complexity 80 80
============================================
Files 224 228 +4
Lines 9035 9280 +245
Branches 1154 1202 +48
============================================
+ Hits 5739 5961 +222
- Misses 2929 2939 +10
- Partials 367 380 +13
Continue to review full report at Codecov.
|
eyalkoren
left a comment
There was a problem hiding this comment.
Very nice!! 🎉
In general, since this is a user-configuration thing, I would print some more errors related to misconfiguration, like:
- usage of non-valid characters
- usage of non-valid key names
Also- add test for dynamically addition and removal of metrics.
apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetricTracker.java
Show resolved
Hide resolved
apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetricTracker.java
Outdated
Show resolved
Hide resolved
apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetricTracker.java
Outdated
Show resolved
Hide resolved
Could you be more specific? There are already quite a few error messages in
All tests already add the metrics dynamically. Removing is not supported at this point. |
I am not trying to make it 100% bullet-proof, but thinking on possible mis-usages, eg:
|
|
@eyalkoren Could you give this another review? |
eyalkoren
left a comment
There was a problem hiding this comment.
Awesome! Two minor name change suggestions.
| } | ||
| } | ||
|
|
||
| private List<JmxMetricRegistration> registerJmxMetrics(List<JmxMetric> jmxMetrics) { |
There was a problem hiding this comment.
This action is not really registering (ie adding to the registry), so maybe something like:
| private List<JmxMetricRegistration> registerJmxMetrics(List<JmxMetric> jmxMetrics) { | |
| private List<JmxMetricRegistration> compileJmxMetricRegistrationList(List<JmxMetric> jmxMetrics) { |
| return registrations; | ||
| } | ||
|
|
||
| private void registerJmxMetric(final JmxMetric jmxMetric, List<JmxMetricRegistration> registrations) throws JMException { |
There was a problem hiding this comment.
| private void registerJmxMetric(final JmxMetric jmxMetric, List<JmxMetricRegistration> registrations) throws JMException { | |
| private void addJmxMetricRegistration(final JmxMetric jmxMetric, List<JmxMetricRegistration> registrations) throws JMException { |
closes #469
Update supported-technologies.asciidoc