Grafana Alertmanager: Alert Conditions
Grafana isgreat for gathering and visualizing data.Its features are not limited to visualization. It includes built-in support Alertmanager. By default, notifications for Grafana managed alerts are handled by the embedded Alertmanager that is part of Grafana. We can configure the Alertmanager’s contact points, notification policies, silences, and templates from the alerting UI. In my previous article about grafana, I explained how the configuration processes are done.
In this article, I will talk about the alert conditions that can be created.
1- NoData Alerts
For example if there is no new data for a query for example 5 minutes. We can use NoData alerts.
- Rule Name: NoData , Evaluate every: 1m ,For:5m
- Condition When: last() query (A,5m,now) has no value
2- Alerts for Disk Usage
We can define an alert for high disk volume; It is set to generate an alert when disk usage exceeds 15.
- Rule Name: HighDiskUsage, Evaluate every: 1m, For:0m
- Condition When: last() query (A, 1m, now) 15
3- Alerts for console error
If we use an internet browser in testing we can also collect console log data. And then if we get a script error on a page we can use this alert.
- Rule Name: VisualChange, Evaluate every: 1h, For: 2h
- Condition When: median() of query (A,2h,now) is above 0
4- Alerts for low privacy
One of the most important metrics we can get from the Coach is the privacy metric that helps us see how good we take care of users.
- Rule Name: LowPrivacy, Evaluate every: 1h, For: 2h
- Condition When: median() of query (A,2h,now) is above 90
5- Alerts for node down
This alert can be generated when any device is not working. This situation can be checked by applying an up query to the data received from the prometheus node experter.
- Rule Name: NodeDown, Evaluate every: 10s, For: 30s
- Condition When: last() of query (A) is below 1
In other cases, alert generation can also be performed. In this article, only the 5 specified alert situations are discussed.