Sending Grafana notifications on Teams channel

niteshsinghal85

Nitesh Singhal

Posted on February 27, 2022

Sending Grafana notifications on Teams channel

Image by [Nitesh Singhal](https://medium.com/@niteshsinghal85)

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.

Teams channel

Click on three dots on the “Grafana” channel and click on Connectors, it will show all the available connectors.

Adding connector

We need to configure Incoming webhook for receiving the notification from Grafana

Configuring Webhook

We need to provide necessary information and click on create button.

Configuring Webhook

You will see a URL is created like in below image.

Incoming webhook URL

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.

configure contact point

configure contact point

We can send test notification by clicking test button.

Let’s try and see the what happens

Test notification in Teams

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.

Adding Notification policies

Adding Notification policies

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.

Real time notification in Teams


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

💖 💪 🙅 🚩
niteshsinghal85
Nitesh Singhal

Posted on February 27, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related