Wire up SORDER
SORDER is a way to order the series returned in a result. This is useful if you're going to return the top or bottom series by some function. For example:
SELECT mean(value)
FROM cpu
WHERE time > now() - 24h
GROUP BY time(1h), host
SORDER max(value) 5m desc
SLIMIT 5
This query says to take the most recent 5m period in the query's time range and compute the max for every host. It would then order those in descending order and then take the first 5 and do queries for them to get their series.
+1
+1
+1
+1
+1
that would be a really useful feature. is there working going on in regards to this?
+1
Please reopen and schedule. This feature would make influxdb much more useful.
+1
I'm now using InfluxDB and Grafana to monitor a 36 node cluster. The previous project had nine nodes. The graph legends become too big and most of the series on the graph are of no real interest. I want to find the things that need action by looking at, say, the worst 5 or 10 nodes but I can't find a way with InfluxDB. A shame because it's really easy with ElasticSearch/Kibana but otherwise Grafana+InfluxDB is a much better fit for my needs. SORDER with SLIMIT seems to be exactly what I need.
Rather a shame to see this issue closed 16 hours before I found it.
We have about the same use-case and problem as @andycarlsonuk. This feature would make InfluxDB actually much more helpful!
Thanks for commenting. We'll keep this open, but it's not currently scheduled for any release yet.
That's exactly my use case as well. We're monitoring hundreds of servers and storing metrics in InfluxDB. Not having a SORDER operator has been a major limiting factor on how useful our graphing is.
It's too the point where when I have down time I'm going to see if I can figure out how to implement it myself
Thank you for reopening this.
+1
I'm looking for an influxdb equivalent to graphite's highestAverage. Other posts have mentioned this but they eventually link to #5930 which contains "Top accepts nested functions", but from what i've seen the top function doesn't return a series.
This looks like the feature request i need to follow. Can anybody confirm?
@clheikes Yeah, totally, all we need from SORDER is to do something like "SORDER BY mean(bytes) DESC LIMIT 10", which would be full analog of highestAverage. But, further, it allows all sorts of series sorting.
from what i've seen the top function doesn't return a series.
Yep, so I have custom script to achieve this (metrics are assigned back to series), but it leads to null values in series and more series returned, for example top(10) would lead to ~30 series. Of course number of series depends on data.
@clheikes this is a pretty big missing functionality and from reading various threads people dont seem to under that the "fix" they are pushing is not actually what the want. they needs a time series of "top".
@vlitvin Could you share an example of your script in a Gist ? it would be helpful.
Without SORDER we can't switch from Prometheus to influxdb enterprise, please add this feature
@white-hat can you give me a little more detail about what you're trying to do with the query?
@pauldix in my use case SLIMIT is kinda useless without SORDER. I can graph a line per server for example but I can't say 'show me the worst 10'. Makes a lot of dashboarding much less useful
@Kaelten the worst 10 based on what criteria? For example, look at the most recent cpu system utilization for every server and take the highest 10 servers, then query them for some period of time? Is it important to say worst over some longer period or the entire period for what is returned?