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
Improve discovery matcher process for Custom Dashboards #3704
Comments
Just though about something so stupidly simple to tackle that, even without the new prom API... |
This sounds doable. |
Just documenting where this |
I think we can do this with the "or" keyword ... so rather than call
Assuming we have something on the order of 20 dashboards (I don't think we have that many out of box), then we really only will return all series for at most 20 metrics. Just a theory. I will see how easy it is to do this. |
See the PR for different ideas of how this can be implemented. |
This is a follow-up on #3660
Prometheus v2.24, the latest version, has improved its API [1] in a way that should drastically improve performances of the metrics discovery process for custom dashboards. Instead of calling
api.Series
, we should callapi.LabelValues
for label__name__
and the labelset to match on (previously, this endpoint didn't accept the labelset to match on as parameter). This endpoint should eliminate the cardinality issue and will return just 1 item per metric family (ie. regardless the number of pods per app), hence should be much more efficient in our case.Since this solution only works with a recent enough prometheus, it will have to live with the alternative / legacy solution (keeping both in code).
Note that this will be possible only with the next version of prom's go client (today v1.9.0 doesn't have the new endpoint, but a PR was merged to update the API, so next release should be good)
[1] https://prometheus.io/docs/prometheus/2.24/querying/api/#querying-label-values
The text was updated successfully, but these errors were encountered: