Grafana - handling NaN in alert expressions

What is the best way to handle NaN in alert expressions? I’m using Reduce (Mean) and then a Math operation to check if the value is greater than some amount. However, the Reduce (mean) is producing a NaN and somehow this results in an alert

Unfortunately, currently, reduce can’t handle NaNs: if vector has a NaN (null or inf) the reduce operation will result in NaN. There are two ways around it: filter out\convert NaNs in the query and use Classic Condition. Also, there is a draft PR to fix that https://github.com/grafana/grafana/pull/43583