-
Notifications
You must be signed in to change notification settings - Fork 9
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
Apply allowlist filter on metricnames with labels #5
Comments
Currently the The main use cases where this is useful are:
The
This brings some challenges if we want to also filter labels:
With these issues, I see 2 potential implementations that solve all issues:
@k-wall @OwenCorrigan76 @scholzj @tombentley
|
@mimaison I think [2] would be enough to handle also other label-matching operators. Therefore, [2] would be the way to go. But few things to take into consideration if we are extracting and then parsing the text inside the
|
The goal is not to re-implement PromQL. We just need a basic filtering mechanism that supports labels too. I think we should really keep it simple as I see the extreme configurability of jmx_exporter one of its drawbacks. It allows writing filters that are hard to understand and ultimately expensive to compute making it pretty slow if you enable too many metrics. |
Do we really need this feature in the reporter? Do we really need it right now? Prometheus already has the ability to drop metrics at ingress time, so if the volume of metrics coming from the reporter was truly bothersome for a user, they'd already have that knob to twiddle. (Aside: doesn't this go beyond the scope of the original Strimzi Proposal?) I'd say let's wait on this one (YAGNI). If we get user feedback saying this is important, then we can think then with a fresh proposal. |
I agree with you. |
@antonio-pedro99 Thanks for volunteering, however the first step is to decide what to do. If you have opinions on the various points being discussed, please share them. |
Following the update of the Prometheus client 4c1fd9e, a trailing commas is no longer injected after the last label. I think it would be worth checking whether we could change the regex separator (maybe to |
I spent some time investigating our various options. The "best" (least worst?) solution I found was to allow configuring the separator for the allowlist and have logic to mimic the Prometheus metric name serialization to compute the expected final name with labels. Here is a PoC: https://github.com/strimzi/metrics-reporter/compare/main...mimaison:metrics-reporter:label_filter?expand=1 This allows users to include labels in their allowlist. For example using the following allowlist:
I only get these metrics:
In the end, it's ok but not a great. The main issues are:
Also while doing this work I identified #30 |
is label order in the serialised form of the metric something that's guaranteed? |
Labels are sorted by name. This is mentioned in the javadoc: https://prometheus.github.io/client_java/api/io/prometheus/metrics/model/snapshots/Labels.html I assume the exposition formats preserve that. |
At the moment, the allowlist is applied on the metric names without the labels. We should allow filtering metrics with specific labels.
The text was updated successfully, but these errors were encountered: