influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Wire up SORDER

Open pauldix opened this issue 11 years ago • 32 comments

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.

pauldix avatar Mar 03 '15 00:03 pauldix

+1

srikara avatar Aug 07 '15 01:08 srikara

+1

will-prcm avatar Nov 11 '15 13:11 will-prcm

+1

zapient avatar Nov 11 '15 16:11 zapient

+1

Kaelten avatar Jan 04 '16 20:01 Kaelten

+1

vlitvin avatar Jan 30 '16 07:01 vlitvin

that would be a really useful feature. is there working going on in regards to this?

nordewal avatar May 10 '16 09:05 nordewal

+1

tbriggs-curse avatar Jun 07 '16 00:06 tbriggs-curse

Please reopen and schedule. This feature would make influxdb much more useful.

Kaelten avatar Aug 17 '16 21:08 Kaelten

+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.

andycarlsonuk avatar Aug 18 '16 13:08 andycarlsonuk

We have about the same use-case and problem as @andycarlsonuk. This feature would make InfluxDB actually much more helpful!

nordewal avatar Aug 18 '16 18:08 nordewal

Thanks for commenting. We'll keep this open, but it's not currently scheduled for any release yet.

jwilder avatar Aug 18 '16 18:08 jwilder

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.

Kaelten avatar Aug 18 '16 19:08 Kaelten

+1

bimalm avatar Oct 05 '16 15:10 bimalm

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 avatar Dec 20 '16 22:12 clheikes

@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.

vlitvin avatar Dec 21 '16 08:12 vlitvin

@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.

mhiller avatar Dec 21 '16 16:12 mhiller

Without SORDER we can't switch from Prometheus to influxdb enterprise, please add this feature

white-hat avatar Feb 15 '17 20:02 white-hat

@white-hat can you give me a little more detail about what you're trying to do with the query?

pauldix avatar Feb 15 '17 22:02 pauldix

@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 avatar Feb 15 '17 22:02 Kaelten

@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?

pauldix avatar Feb 15 '17 22:02 pauldix