Day 77 : Grafana Alerting

Day 77 : Grafana Alerting

Β·

4 min read

Introduction to Grafana Alerting

  • Whether you're new to Grafana Alerting or have some experience, discover the basics and features that can assist you in making, handling, and reacting to alerts. This will enhance your team's capability to quickly address and solve problems.

What is Grafana Alerting?

  • Grafana Alerting allows you to alert on your metrics and logs, no matter where they are stored. Create, manage, and take action on your alerts in a single, consolidated view, and improve your team’s ability to identify and resolve issues quickly.

Benefits of Grafana Alerting:

  1. Easily manage your alerts: No need to look at multiple pages for managing alerts in Grafana. A single Grafana Alerting page consolidates both Grafana-managed alerts and alerts that reside in your Prometheus-compatible data source in one single place.

  2. One alert rule, multiple alert instances: Grafana Alerting can give you system-wide visibility with a single multi-dimensional alert. One alert rule can alert on many items at once, creating one alert instance for each entity that needs your attention. You can also group alert instances based on labels to not receive too many notifications!

How Grafana Alerting works

image

  1. Alerting rules are defined in Grafana and are evaluated in the Grafana backend.

  2. Labels are extracted from the metric data and added to the alert instance.Also match alert instances to notification policies and silences and can be used to group your alerts by severity.

  3. Severity=warning is added to the alert instance.

  4. Notification Policy is evaluated and the alert instance is sent to the Slack channel or Email.It is the set of rules for where, when, and how the alerts get routed. Notification policies have a tree structure, where each policy can also match specific alert labels.

  5. Contact Points define how your contacts are notified when an alert fires. We support a multitude of ChatOps tools to ensure the alerts come to your team not the other way around.

Similar Diagram

image

  • Alerts are sent to the alert receiver where they are routed, grouped, inhibited, silenced and notified. In Grafana Alerting, the default alert receiver is the Alertmanager embedded inside Grafana, and is referred to as the Grafana Alertmanager.

  • Before building the Grafana Alerting, we need to install the Grafana in our system or on cloud.

  • For detailed installation steps, please visit my Day 73 Blog for complete steps on how to Install Grafana on AWS EC2.

  • Blog Link : Grafana Installation on AWS EC2 Instance

  • After installing Grafana, we need to configure Grafana Loki and Promtail to collect the logs from the system which I have already explained in my Day 75 Blog.

  • Blog Link : Grafana Loki and Promtail Setup

Task-01

  • Step-01: Go to Grafana Dashboard and click on Alerting option.

Screenshot from 2023-11-21 00-41-47

  • Step-02: So in Alerting section, we have Alert Rules and add the data source which we have already configured in our previous blog Loki-1. So we will be using the same data source.

Screenshot from 2023-11-21 01-20-06

  • Step-03: Now we will create a new alert rule for Error Alerting. So click on New Alert Rule.We can also add other Alert Rules like Warning and Critical.

Screenshot from 2023-11-21 01-22-56

  • Step-04: Now we will define the Query for the Error Alerting. So we will use the same query which we have used in our previous blog Loki-1.

Screenshot from 2023-11-21 01-23-16

  • Step-05: Here we will Set the Evaluation Behavior in which we will store the Rule State and we will also set the Evaluation Delay to 5 minute.

Screenshot from 2023-11-21 01-24-39

  • Step-06: We will keep the Annotations and Notification as default and then click on Save.

Screenshot from 2023-11-21 01-25-08

  • Thus we have successfully created the Error Alerting in Grafana which will alert us if there is any error in the system.

Screenshot from 2023-11-21 01-25-38

  • So we will be getting the Error Alerting report in every 5 minutes as we have set the Evaluation Delay to 5 minutes.

Screenshot from 2023-11-21 01-26-16


πŸš€πŸ‘‰ Follow for more awesome content like this! πŸ‘ˆπŸŒŸ

Did you find this article valuable?

Support DevOps by becoming a sponsor. Any amount is appreciated!

Β