No Data to "0" value in Grafana 9.5 alerts

Hi All,

I’ve been trying to get the time series with no data to replace it with “0” in the math expression, but I’ve had no luck so far.

Let me get a bit more into details:

  1. I have a query $A that sums all the phone numbers in the given time series

  2. I have a query $B that sums all the phone numbers, but I want to exclude the repeated ones, so I have a terms aggregation like this:

  3. let’s say $A sum = 30, and there were no repeated numbers in the $B time series, so when I do Math Expression: $A - $B, I’d like to get 30-0=30, and instead, I’m getting No data all the time:
    image

Is there a way I can assign the zero value to the “no data” results from the time series?

The reduce function didn’t work for me; I’ve also tried a couple of math formulas to do that (ifNull(); $A - ($B || 0)), but these are not supported.

I’m using ES as a data source.

Any ideas/suggestions would be much appreciated!

Unfortunately, it’s not possible in multi-dimensional alerts when evaluation returns more than one result\metric\dimension. If you do need this, try explore Classic Condition. It has different behavior than other expressions because it aggregates all dimensions\metrics before applying the threshold. That expression supports handling of no-data.

1 Like