

Need the Grafana slack monitoring alert? Let's create it now. - Knoldus Blogs
source link: https://blog.knoldus.com/grafana-monitoring-slack-alert/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

In my previous blog, we created the first Grafana dashboard. Now in this blog, we will create our first monitoring Grafana alert.
Before creating monitoring alerts, we need to add the notification channel through which we will be notified. Here, we will be adding slack as the notification channel.
Slack notification channel:
First, open the URL http://localhost:3000 in the browser and log in to the Grafana. Then click on the “Notification Channels” option at the left-hand side.
Then click on “Add Channel” button and you will get the following screen:
Then, select the Slack from Type field and provide the Slack webhook URL. (Other fields are not mandatory). We can set up other alerts as well by selecting the option from Type field. For slack webhook URL, please see the guide here.
Few key points:
- If you want to add this channel to all the alerts by default then tick the checkbox for “Send on all alerts”.
- If you want reminders then tick the checkbox for “Send reminders” and reminder frequency time.
You can test the setup by clicking on “Send Test” button at the bottom. After setting up all the fields, just click on the Save button. For more details, check out here.
Now let’s create the alert.
Go to Dashboard → Manage → (Please find these options at left-hand side). Click on Dashboard Edit to set alerts:
Go to the Alert section of the dashboard and create an alert there:
In alert section, Set the Alert Config and Notification as per the requirement.
alert config:
In alert config, we need to add the conditions. We can add multiple conditions here. We need to use either AND or OR to make the relationship between multiple conditions.
As a condition, we get only 5 options:
- IS ABOVE
- IS BELOW
- IS OUTSIDE RANGE
- IS WITHIN RANGE
- HAS NO VALUE
You will find “Evaluate every” option there which takes 2 values:
- every: Within how many seconds/minutes conditions need to be evaluated
- for: For how long the condition needs to be evaluated.
For ex: Evaluate every 20s for 40s.
It means conditions will be evaluated in every 20 seconds but for 40 seconds. It means it will be evaluated 2 times.
Alert is having 3 states:
- OK: When the overall value of conditions are false
- Pending: When the overall value of conditions is true
- Alerting: When the overall value of condition is true continuously until the value of for.
If we take the above example then it will go in alerting mode when the conditions get true for continuous 40 seconds.
notification:
Here, we add the notification channel where alert needs to be sent and the alert message. For more details, check out here.
That’s it. I hope, it will be helpful for you and you will be able to create your first alert easily.
References:
https://grafana.com/docs/alerting/rules/
https://grafana.com/docs/alerting/notifications/
Recommend
-
11
Extending Functionality Reading Time: 2 minutesWe had an interesting case of enhancing the functionality of a logging library with our own case to feed data into DataDog....
-
10
User Authorization using JWT Reading Time: 4 minutesAround all the buzz words flying in the micro-service development area, one of the hottest is JWT (JSON Web Token). We often encounter JWT in already establish...
-
9
Building API with gRPC – Part 1 Reading Time: 3 minutes Hey everyone, have you ever faced the problem to create the applic...
-
5
Reading Time: 2 minutes Welcome folks!In most of the client calls, we come across the following questions :– “Send me the entire logs of the file”– “I want the logs with timestamp”– “I want the log file of th...
-
12
Program Increment and It’s Planning Reading Time: 4 minutes SAFe is no Magic except for Program Increment Planning. No eve...
-
11
Scripting Library in Scala – Ammonite Reading Time: 4 minutesAmmonite is a Scala library that lets us use Scala language f...
-
6
Reading Time: 5 minutes You would always get a ton of literature on Event Sourcing and CQRS. The key question is WHEN do you use it? Under what circumstances? Is your problem really in need of ES? I would not go into the details of...
-
10
Reading Time: 4 minutes DC/OS is a distributed systems kernel that lets you manage multiple machines as if they were a single computer. Its included web interface facilitates user to interact with its services. Now, this is where it gets qui...
-
14
Reading Time: 3 minutes As we can discuss a lot about React Hooks in React Hooks: Introduction – Part 1. In this blog, we are going to discuss the useState
-
7
Diversifying Angular app – multi-lingual support Reading Time: 7 minutes Hi! Welcome abroad on this journey. Today, we are...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK