Grafana: Using Microsoft Teams for our notifications when established thresholds are exceeded

Greetings friends, after so many years counting all the possibilities Grafana, InfluxDB and Telegraf, I have come to realize that we have never dealt with the subject of notifications, so that Grafana alerts us when a value exceeds a certain threshold.

Grafana has several methods of sending notifications, Email, Slack and many others that you can see here:

Today I come to tell you how to configure the notification to Microsoft Teams

Webhook Configuration in Microsoft Teams

To be able to receive notifications to a specific channel, we will have to create a Webhook in the channel we need, normally it would be a channel to receive alarms, instead of bombarding the General channel or similar.

In the channels where we need notifications, imagine that we want a certain team to receive notifications of their applications, we will go to the channel – ConnectorsSelect the connector called Incoming Webhook: Select now the big button called Add: Select the name we want for our Webhook, as well as an icon that we like: When you click Create, will show a unique URL with the Incoming Webhook, this is the address we want to use in Grafana:

Configuration of our alarms in Grafana

Now that we have everything ready, we can go to our Grafana, and in the menu on the left we can click on Alerting – Add channel:We will select a name that we like, besides selecting the values that we want in the options, we have to mark Default and for example images if we want to receive images in our Teams: When making a test, we will be able to see in our channel of Microsoft Teams an alert of test: Inside our Dashboards of Grafana, we will select the graph of which we need to extract the value to monitor with thresholds: We will go to the Alerting part, is an icon on the left very easy to discern, we will introduce now the thresholds of the query we need, for how many minutes it has to happen to be considered alarm, and we will see below the notifications to Email and Teams: When we exceed the threshold we have introduced, during the time stipulated, we will receive the alarm in the Microsoft Teams channel: An important issue, not all the ways of showing metrics allow us notifications, for example the singlestat does not allow it, but the graphs do.

Nothing more friends, I hope you like it, and you will find it useful.

Author: jorgeuk

Father, writing in and Blogger, Systems Engineer @veeam - vExpert 2014/2020 & NTC 2018/19

17 Thoughts

  1. Hello Danilo,
    Does your Grafana server has access to the Internet, not only that, but also proper DNS resolution? It seems that the DNS server on the port 53 can not be reached, which it is a really weird DNS configuration anyways.

    Take a look at your DNS resolution on your Grafana server.

    Best regards

  2. Hi, Thank you! It works fine, but when on mobile device (Android) alert doesn’t give any details about the graph is the alert (so that I can consider is it critical or not). How this could be solved?

  3. Hello,
    It seems it is a bug on Grafana itself, I will need to check on github.

    Best regards

  4. I have the same VMWare dashboard as you, but i get this error message when adding the alert.

    “Template variables are not supported in alert queries”

    Don’t you use template variables?

    Best regards

  5. Hello,
    For alerts, you need to use a query without a variable, it is a pain to be honest, but I am preparing another post in how to send alerts for this in a better fashion.

  6. jorge
    that would be perfect, i would be happy if your post would appear in the matter soon.

  7. Hello,

    /* sorry for my bad english */

    Thanks for the post. I’ve already done this configuration but i don’t get how can we see graphs in the alert (on Teams).

    When i’m testing it, it’s working fine.
    But when i receive a real alert, any graph is present in the alert’s message.

    Do you have any idea about how can i solve this please ?



  8. I’m running grafana on a VM and when I tried to test it, it failed with x509: certificate signed by unknown authority error message. Do you have an idea to solve this?

  9. is it possible to send an alert message to ms teams without any certificates?
    For example, in terminal window I can send a message to ms teams via incoming webhook using curl –insecure option.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.