In this short tutorial we will learn how to send notifications from Grafana to Microsoft teams channel.
For this tutorial, I am using latest version of Grafana, It is important to know that from version 8.3 Grafana has changed the way of configuring alerts and notification, so this article will be applicable from version 8.3 onwards.
so let’s setup Teams channel first
Configuring Microsoft teams
Create Teams channel: I am creating a new Teams channel called “Grafana” so that I get all the Grafana notifications here.
Click on three dots on the “Grafana” channel and click on Connectors, it will show all the available connectors.
We need to configure Incoming webhook for receiving the notification from Grafana
We need to provide necessary information and click on create button.
You will see a URL is created like in below image.
Copy the URL, We will need to provide this in Grafana.
Good our Teams channel setup is ready.
Now let’s move to our Grafana instance
Configuring Grafana
For this experiment, I am running a docker version of Grafana
With new version of Grafana, we have to configure contact points.
Let’s configure one for MS teams.
We can send test notification by clicking test button.
Let’s try and see the what happens
as you can see, we have received a test notification in Teams channels.
Now go to notification policies tab in Grafana UI. By default we already have one notification policy configured.
Let’s add one more for Teams.
Now Grafana is ready to send notification whenever alert rule is matched.
I have configured a limit a for RatePerSecond for my API call and whenever it crosses the limit I will get real time alert like below in my teams channel.
Summary
With the increasing use of Microsoft teams for daily work it could be useful to get real time alert with same channel.
Although I have taken example of Grafana but the same technique can be used for getting notification from different applications.
Even you can integrate this technique in your application.
Hope it is useful.
Happy Learning..!
Originally published on Medium
Top comments (0)