1
votes

I have a query which returns group with one single value and want to use it in Grafana dashboard SingleStat, but Grafana expects one value (scalar) instead of group. How to make conversion?

1

1 Answers

4
votes

Assuming you are using the Bosun app plugin you should be able to do something like:

$q = avg(q("sum:$ds-avg:os.mem.percent_free{host=myhost}", "$start", ""))
series("", epoch(), ungroup($q))

To generate a series with a single value:

single value series

Which should work for the Singlestat panel in Grafana.