Configuring Grafana alerts to immediately notify when additional sensors fail within a 6-hour alert interval

Hi Grafana Community,

I’m setting up alerting in Grafana for monitoring faulty sensors in our company. I have a SQL query that returns the count of faulty sensors, where 0 indicates no faults. Currently, I have an alert rule that triggers when the count is greater than 0, and this alert repeats every 6 hours. However, I want to improve this setup to detect and alert if additional sensors become faulty within the 6-hour window. I need a new alert to trigger immediately instead of waiting for the next 6-hour interval. How can I configure Grafana to handle this scenario, possibly using expressions or any other method to compare the current count of faulty sensors with previous counts? Any advice or examples would be greatly appreciated.