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.