I need to create a TOP10 table of memory usage on hosts including a graph. I can do that in expression, by using limit($query, 10), so it's good for alerts and tables, but I've got a problem with limiting hosts on this graph. Limit returns a number and I need a series to be able to draw it. Is it possible in Bosun to limit number of hosts in graph?
The filter function can do this:
$q = q("avg:rate:os.cpu{host=*}", "5m", "")
$f = limit(sort(avg($q), "desc"), 10)
filter($q, $f)
In this $q (SeriesSet) gets filtered to existing, and/or non-zero results of $f. $f is a NumberSet.