On a Grafana dashboard I have a stat panel showing the number of hosts that have operating system updates pending. The PromQL query looks like this (
os_updates_pending is a custom OS-agnostic metric):
count(sum (os_updates_pending) by (hostname) != 0)
This works well if there are hosts with pending updates, but if there aren't I'm getting "No data" instead of "0" as a result. I know I could set the "No value" option to "0" to get a zero displayed instead, but the data link for clicking through the panel to a details view still won't work (because the value is still empty, not 0). How can I fix that?