-
Notifications
You must be signed in to change notification settings - Fork 544
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
Idea: Make it possible to analyse all values of a label with the /api/v1/cardinality/label_values
endpoint
#10328
Comments
I'd be happy to work on the implementation of this change with the blessing of the Mimir team. |
We appreciate that the Mimir team is coming back from vacation and would be happy to get some input on this change request. |
@narqo @dimitarvdimitrov @pracucci Would the Mimir team be able to take a look at this proposal? As mentioned, we are happy to do the implementation. |
Hello @LasseHels , I think adding functionality to get the rest of the results from the cardinality APIs is great but my preference would be to add an |
Happy to hear an opinion from @Logiraptor or @flxbk. |
Have you considered using the active series endpoint to retrieve the information you need? That endpoint should give you all the information you need to answer questions like
and it should also be able to support a more detailed analysis of cardinality data than "just" at the metric level. |
@flxbk We did try out the active series endpoint, but there are a couple of issues. We consistently get It is our understanding that the From my naive perspective, the Thoughts? Footnotes
|
I agree that if you don't need more granular data for your analysis than what As to your original question, I think it's reasonable to remove the maximum value for the |
👍
My understanding is that the The If this is correct, then I'm not sure I understand how raising or removing the maximum value of the Can you elaborate a bit on why you think a more generous |
What is the problem you are trying to solve?
We are currently working to reduce the amount of active metric series of the observability platform at Maersk. As part of this effort, we need a way to retrieve all metric names and, ideally, rank them by series count.
Knowing the series count of each metric is important as it allows us to do things like:
The
GET,POST <prometheus-http-prefix>/api/v1/cardinality/label_values
endpoint is a prime candidate for our use-case. The issue is that the endpoint has a maximum limit of500
. In other words, with this endpoint, we can only get the top 500 highest cardinality metrics of the platform.This is an example of the request we're currently making:
Which solution do you envision (roughly)?
Initially, we suspected that the
limit
parameter was in place to protect server-side resources. However, we inspected the code of the endpoint, and it is our understanding that the endpoint always fetches all label values, and that the only thing thelimit
parameter does is control how many are returned (source).We'd like for the
limit
parameter to have no maximum value:limit
parameter is the same:limit
will default to20
.limit
smaller than500
is the same.limit
greater than500
changes: they would previously fail with'limit' param cannot be greater than '500'
but will succeed after the change.limit
to a greater value like100000
.Have you considered any alternatives?
We've considered two alternative solutions:
GET /prometheus/api/v1/label/__name__/values
. The issue with this endpoint is that it doesn't return series count.count by (__name__) ({ __name__=~".+"})
. This query is prohibitively expensive to run, and fails almost immediately with athe query exceeded the maximum number of chunks
error.Any additional context to share?
We might consider whether to make the same change for the
limit
parameter of theGET,POST <prometheus-http-prefix>/api/v1/cardinality/label_names
endpoint.My soft opinion might be that the two endpoints should have the same implementation of the
limit
parameter, but I am not privy to the details of this endpoint.How long do you think this would take to be developed?
Small (<= 1 month dev)
What are the documentation dependencies?
We'd need to update the documentation for the label cardinality endpoint: https://grafana.com/docs/mimir/v2.14.x/references/http-api/#label-values-cardinality
Proposer?
Lasse Hels
The text was updated successfully, but these errors were encountered: