Hello ,
Generally i am creating an cpu alert rule in grafana for proemetheus datasource.
Here i want to get the alert to evaluate for every 24hrs.
Where i have to mention this.For every 24 hrs i want the condition to be checked.
And also is there any solution to disable the alert for if there are no alerts for that particular rule for last 24hrs.
Can anyone clarify.
Thanks in advance
Not sure this can be done but what you can do is decide how long the limit of your condition (e.g let’s say your limit is 10) must be true before the alert fires. This is the for part of the evaluation. For instance fire the alert if the value of my query is 10 during 5 min.
Once a condition is breached, the alert goes into the Pending state. If the condition remains breached for the duration specified, the alert transitions to the Firing state, otherwise it reverts back to the Normal state. After 24 hours the condition of the alert will be evaluated again.
Sum the value of the rate of container_memory_usage_bytes for the past 24h interval
Is the last value of the rate is more than 10?
If the value exceeds the limit (10) for more than 0 seconds (fire immediately).
-OR-
You can also adjust the for parameter if you don’t want to fire immediately. For example, if you want it to only fire if the limit is still exceeded after the condition is next evaluated (in 24 hours) then set for to 24h. Note that the alert will remain pending until 24h has elapsed