TOP N graphs/series in Grafana



I am trying out combination of newest releases of telegraf, influxdb and grafana.
My goal is monitor thousands of network devices from which every device might have hundreds of interfaces.
I what to create overview dashboard with graphs of for example top 10 most utilized interfaces per device.
I have made graph with all interfaces per device with query:

SELECT derivative(“ifHCInOctets”, 1s) *8 FROM “interface” WHERE (“agent_host” = ‘’) AND $timeFilter GROUP BY “ifDescr”

I have tried SLIMIT but it randomly selects some interfaces. I can not find a way to limit output to TOP 10 series.
For example Graphite has function highestAverage (10).

I saw this question asked in forums few times over the years but no solid answer was provided.
Perhaps this is possible to do with a help of other influx products.


Kapacitor can be used to help with this.

I think the option that would be best is similar to this Live Leaderboard example.


This is a very important question, for people not using (and not planning to use) Kapacitor.

Additionally, are there plans to introduce “order by anything else apart from time” eg. sum etc in the near future and therefore give a way to obtain “top n” series ?

Or is there a workaround to obtain the TOP N series ?


Support for TOP N was recently added to IFQL:

I don’t know if there are any plans to add it to InfluxQL, as IFQL is supposed to replace it in the future.


Thanks, i wasn’t aware of ifql – i hope it gets supported in grafana one day :slight_smile:


Did you found a suitable solution for your request ?