Path

Set a threshold, preview the result, then add a recovery threshold.

Estimated time: 1 min

Set the alert condition and recovery

Your query returns a percentage. Tell Grafana when that percentage is too high, then add a recovery threshold so the alert doesn’t flap near the trigger point.

Set the threshold to 5 so the alert fires when the error rate goes above 5%. Then set recovery to 3 so it returns to normal only after the rate drops below 3%.

  1. In the Alert condition section, leave Is above selected.

  2. Set the threshold to 5.

  3. Click Preview alert rule condition to evaluate the threshold against your query.

    Look for a result row above the button (for example Series 1 with a value). It may show Normal or Firing. With a threshold of 5, Normal is expected when the error rate is under 5% right now.

  4. Still in Define query and alert condition, turn on Advanced options at the top of that section.

  5. Scroll down to the Expressions area and open the C Threshold block. Under IS ABOVE, turn on Custom recovery threshold.

  6. Still in C Threshold, in Stop alerting (or pending state) when below, set the value to 3.

The alert threshold is set. If you added the custom recovery threshold, the rule can return to normal below 3%. Next, create a folder and add labels.