-
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
Positive match to a rule should not consume the metric #901
Comments
@vbence Looking at the code... ( jmx_exporter/collector/src/main/java/io/prometheus/jmx/JmxCollector.java Lines 589 to 602 in 9bc7c43
... if Are you setting |
@dhoard I am seeing the same behavior (and would find option to not consume metric useful), and I don't have cache set anywhere in my configs. Also docs state that this is currently default behavior:
|
@zefir6 I have concerns that this will negatively impact performance for a large set of rules since this will run through all rules for all MBeans. I feel changing the exporter behavior, potentially in a way that would negatively impact performance, to prevent dashboards changes encourages technical debt. I will discuss this with @fstab. |
Thanks @dhoard , that is definitely a workaround, but we not always have access to bespoke Prometheus rules, this feature would allow to solve this issue close to where it arises. |
@vbence @zefir6 it's less about "can it be implemented" but more around "should it be implemented." This feature will dramatically affect performance, introduce technical debt, and cause support burden by misuse. IMHO, the real solution is to change rules and fix dashboards. I am going defer adding this at this time. |
The exporter's current behavior is that the first matching rule consumes the metric which will not be visible to subsequent matches. In the example below only the first rule will display any metrics from
MyLegacyMetricsBean
.I am doing a refactoring of my metrics and I would like to support the old and the new metrics for the foreseeable future. These overlapping rules would provide backward compatibility while also exposing the legacy metrics on the new naming convention.
I recommend a property settable on the rule level to override the current behavior (e.g.
consume
which defaults totrue
).The text was updated successfully, but these errors were encountered: