Kapacitor Alarm debounce

Wondering how to debounce an alarm? Alert on anomaly past a certain threshold value, let’s say 3.0. If the values oscillate between 2.9 and 3.1, many alarms get triggered. How do I generate alarms in a way that it captures 3.0 and only generates the alarm when the values drop down to 2.7?