Sending Grafana notifications on Teams channel
Tags: grafana, msteams, webdev, productivity
Published: 2022-02-27 05:41:59



![Image by [Nitesh Singhal](https://medium.com/@niteshsinghal85)](https://cdn-images-1.medium.com/max/2546/1*gzkK9aRcyICmLuzW03ab2w.png)

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](https://cdn-images-1.medium.com/max/2000/1*du4z5lQQURZBUj-7q2EtxA.png)

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

![Adding connector](https://cdn-images-1.medium.com/max/2000/1*f1RJrUJfF4fBRT6s0ug2mQ.png)

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

![Configuring Webhook](https://cdn-images-1.medium.com/max/2000/1*I4feC7Ru1yaGREQxmeShWQ.png)

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

![Configuring Webhook](https://cdn-images-1.medium.com/max/2000/1*PpJFLHoFAH1LlUXO5wZA7Q.png)

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

![Incoming webhook URL](https://cdn-images-1.medium.com/max/2000/1*QyKdBvByBW-uBLHoxXDbMg.png)

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](https://cdn-images-1.medium.com/max/2596/1*G66WuI71Xmo50gzUldh7fA.png)

![configure contact point](https://cdn-images-1.medium.com/max/2566/1*MTggs8_JCc--2EMco0-2Xw.png)

We can send test notification by clicking test button.

Let’s try and see the what happens

![Test notification in Teams](https://cdn-images-1.medium.com/max/2606/1*KacppSUabGoOUfVgXAJ8Sw.png)

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](https://cdn-images-1.medium.com/max/2584/1*T86ZuYRRuTlO7abSC7enHw.png)

![Adding Notification policies](https://cdn-images-1.medium.com/max/2390/1*XXx4vf0la2sY-Ihh4PXVAg.png)

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](https://cdn-images-1.medium.com/max/2000/1*N5jsMbOWsKvjG4XB2ygeww.png)


---

## 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](https://medium.com/@niteshsinghal85/sending-grafana-notifications-on-teams-channel-cefd88749420)