-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Duplicate metric error when mapping two MBeans to the same metric with different label #988
Comments
@IncandescentChrysalis This appears to be a bug. I have written an integration test and reproduced the issue. InvestigationThe exception is generated from the underlying client_java library. [duplicate metric name.](https://github.com/prometheus/client_java/blob/ac0a930dd213bc598030af417e58478ba29d669e/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/PrometheusRegistry.java#L60-L80) In the exporter, we try to reuse the same builder if the rule name matches. WorkaroundTo workaround the issue using
|
Thanks for having taken the time to look into the issue and having improved the tests suite! The circumvention would wreak havoc in out monitoring system. |
@IncandescentChrysalis are you using the Java agent or the standalone (HTTP) version? |
InvestigationI have created a branch with a test that reproduces the issues. Branch https://github.com/dhoard/jmx_exporter/tree/issue-988 Integration test Integration test configuration |
Java agent |
InvestigationJvmMetrics collector When using the Java agent exporter, the exporter registers a jmx_exporter/jmx_prometheus_javaagent/src/main/java/io/prometheus/jmx/JavaAgent.java Line 54 in db0cc44
The Reference: https://prometheus.github.io/client_java/instrumentation/jvm/ Exporter rules that define overlapping metrics named collected by the
Solution
|
I am unsure if the If that is the case, my original question stands
As of now, there is a functional regression, upgrading a working configuration achieving this from |
@IncandescentChrysalis The code is working as designed/documented in the 1.0.1 release announcement (https://github.com/prometheus/jmx_exporter/tree/release-1.0.1/docs) and Solution
|
I finally understood what is happening. The JVM metrics, originally managed by the current exporter directly, is now off-handed to your Moreover, there is no control over JVM metrics anymore since you hardcode the use of |
@IncandescentChrysalis previous versions of the exporter used an older version of You could have duplicate metrics with potentially different values. The change was required to support upcoming OpenTelemetry support and is referenced here... https://github.com/prometheus/jmx_exporter/tree/release-1.0.1/docs#notes ... but I'm sure it could be improved. |
I have been successfully using the following configuration up until
0.19.0
:Trying to upgrade to
1.0.1
, I now encounter the following error:How do I add several values to the same metric on distinct labels with
1.0.1
?The text was updated successfully, but these errors were encountered: