I have a series with a few hundred different tag values in Influxdb. How would I tell Grafana to plot the top-3 only? Where top could be calculated on the last sample.
I can find the top() values, but only for a single time value, like this:
select top(value, 3), tld from (select last(value) as value, tld from tld_counter group by tld)
Unlike some other time series databases, InfluxDB does not support series filter (that I know of). So you will have to wait for InfluxDB to implement this
Indeed InfluxDB does not sort on anything but time (in that case I believe SLIMIT would do what we’re looking for).
But today, top() does the trick anyway. I have a point for each user every interval, like
usage,user=xyz cpu=99,mem=99
An InfluxDB query does that with
select top(cpu,3),user from usage where time > now() - 30m
But I can’t see how to convince Grafana to use the user from the fields rather than from multiple result sets like you get with GROUP BY.