grafanaopentsdbbosun

How do i convert NumberSet group with single value to the scalar in Bosun?


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?


Solution

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