Grafana Alerting with Telegram Webhook

Overview

Grafana is great but unless you are going to stare at monitoring panels all day and night then you might want to get some alerts. I’ve found a nice way (and free way) to setup effectively a webhook to Telegram.

Setup Telegram and Grafana Alerts

  1. In Telegram search for Botfather

  2. Issue the “/newbot” command

  3. Enter a name for the bot

  4. Enter a username for the bot

The bot will issue a API token

Add that API token to the “BOT API Token” part of Grafana alerts

  1. Open a new message to the bot and type “/start”
  2. Issue the following curl statement in any web browser

Replace "\<TOKEN>" with the API token

https://api.telegram.org/bot/getUpdates

Example return

{"ok":true,"result":[{"update_id":123456789,
"message":{"message_id":1,"from":{"id":1234567890,"is_bot":false,"first_name":"FIRSTNAME","last_name":"LASTNAME","language_code":"en"},
"chat":{"id":1234567890,"first_name":"FIRSTNAME","last_name":"LASTNAME","type":"private"},"date":1591782293,"text":"/start","entities":[{"offset":0,
"length":6,"type":"bot_command"}]}}]}
  1. Save and test

Results