-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add the possibility to get TOP N groups when aggregating metrics #465
Comments
can you provide an example of what you mean? |
For example: if you have a cost metric (we're using gnocchi to store rating measures) and you want to get the top N projects that are spending more money, just to mention one possible use case. |
wow! @scolinas I have same requirement like you . I wrote some code using aggregation to implement this ,but not efficient. I think we should add some API like this : method: body:
then , the result should be like this:
|
The rule for ordering metrics have a good chance to be different depending of what the metric represent (e.g: a cost, cpu_util, a rate), and also if the meter is a gauge, a delta, .... The API already allows to group by resource attributes retrieved with aggregates API. For example:
Request:
Answer:
Note that Now we have this list, it's easy to order it as you like and pick to top N. I don't think Gnocchi should do the If the aggregates API call is well crafted, the ordering/filtering should be fast and straightforward on the client side. In my use case, sorting/filtering is easy because I ensure I got only one point per timeseries. |
Also my example use resample, in case you didn't set an archive policy with a 1 week timespan.
|
Even if there's no code to write, we should at least document this with an example. |
@sileht Hi! Thanks for the explanation. I was thinking about the generic case where you could have one or multiple points, in this case the resampling feature can be used to resample the timeseries (using the same aggregation and reaggregation) to get aggregated timeseries with only one point so you can easily sort and get the top N. What do you think? |
We should list all REST API use-case that people is asking for, to not get issue opened for new feature when it's already possible to get the data. It's not always clear what API call I need to do to get all informations I need for a use-cases. This change starts a new section and add one example. Related gnocchixyz#465.
We should list all REST API use-case that people is asking for, to not get issue opened for new feature when it's already possible to get the data. It's not always clear what API call I need to do to get all informations I need for a use-cases. This change starts a new section and add one example. Related gnocchixyz#465.
@sileht, I still think this feature should be handled by gnocchi api because the use case it's very common when you plot the timeseries in a chart for example, and you probably want to get the less significative categories althogether aggregated in the same manner in a new category "N More" (that aggregation definitely should be handled by gnocchi). It is not trivial to get the top N and others aggregated to plot in a chart when you have multiple points and having that feature native in gnocchi api would be differentiator. |
i'm ok with having it in Gnocchi if absolutely required. that said, the point @sileht is making is that whether it's done on server or client, they will be the exact same operations. because you're query is querying in an orthogonal dimension to what gnocchi stores it's data as, it will be doing the same steps of pulling every single data series, getting the last point, etc... whether it's done on server/client makes it no more/less efficient. |
We should list all REST API use-case that people is asking for, to not get issue opened for new feature when it's already possible to get the data. It's not always clear what API call I need to do to get all informations I need for a use-cases. This change starts a new section and add one example. Related gnocchixyz#465.
Probably less things to transfer to client if u can do it server-side? |
We should list all REST API use-case that people is asking for, to not get issue opened for new feature when it's already possible to get the data. It's not always clear what API call I need to do to get all informations I need for a use-cases. This change starts a new section and add one example. Related gnocchixyz#465.
i think in this case it's negligible but yeah, i see your point :) |
We should list all REST API use-case that people is asking for, to not get issue opened for new feature when it's already possible to get the data. It's not always clear what API call I need to do to get all informations I need for a use-cases. This change starts a new section and add one example. Related #465.
When the selected grouping has many results it will be usefull to get top N and others alltogether aggregated.
The text was updated successfully, but these errors were encountered: