---
# System prepended metadata

title: '**Integration of telegram bot to grafana**'

---

# **Integration of telegram bot to grafana**

    First we need to log in to Telegram.Once you have successful logged in to telegram.
    
    Create a Telegram bot: You can do this by talking to the BotFather in Telegram. The BotFather will give you a unique token that you will use to authenticate your bot just follow the below steps.
    
     Type in search box <BotFather> and click on it. <BotFather> telegram bot will assist you to creating your bot.

    Next click on <START> to begin to communicate with <BotFather>

    Type /newbot to create a new bot
    
    Next <BotFather> will ask you to choose a name for your new bot. In this case <grafana_test> is chosen as bot name
    
    The <BotFather> will also ask you to choose a username for your bot. The username must in end `bot` also must unique. In this guide <grafana8373_bot> is chosen as username. After that you will get your BOT HTTP API token and it will be used to control your telegram bot.
    
    In this case BOT HTTP API token:
    5905508508:AAGKvPvTGHpNgAFoa45sfxeLN8haMt1G9xs and it will be used in the last step to set up notification channel on the grafana
    
    Open your web browser and visit https://api.telegram.org/bot<your-HTTP-API-token>/getUpdates, instead <your-HTTP-API-token> put your HTTP API token. At the moment there is nothing to show on the web browser, since a bot is just created. However leave it open to get Chat-ID on that window in the next step
    
    Next we’re going to create a new group on the telegram which will be used to receive the alerts from Grafana. To do that click on top left corner and select <New group>
    
    Type your bot’s username (in this case grafana8373_bot) and select your bot to add into the group, then click on <NEXT>
    
    Next choose your group name (in this case <Alert_bot>) then click on <CREATE GROUP>
     
    We’ve just created a new group on the telegram. Click on the top <your-group-name> to get a list of your group members. 
    
    To get bot’s Chat-ID, bot have to be part of some activity. Here we’re going to use <Add to group> to add the bot into the another group and after get the chat-id remove from the bot from second group.
    
    Go back to the web browser, which we’ve already opened previously and press <F5> then you’ll get bot’s <Chat-ID>
    For example= chat-id:-1001769157187
    
    Bot <Chat-ID> should begin with a minus <-> sign. In this case Chat-ID:-1001769157187 and it will be used in the last step to set up notification channel on the grafana.

Now your telegram-bot is ready to be configured as notification channel on the grafana.
    
# 
# **Add notification channel to the Grafana**

    First we need to log in to Grafana put your username and password to log in. The first time username and password is admin and admin.
    
    Once you have successful logged in to grafana, click on <Alerting> (Bell icon on the left panel) and select <Notification channels>
    
    Then click on <Add channel> to add new notification channel to the grafana
    
    Choose a name for the notification channel. Here <telegram-grafana-alert> is chosen as name of the notification channel
    
    Choose <Telegram> in the dropdown menu
    
    Provide your telegram BOT HTTP API token which is already created above 
    
    Put your bot’s <Chat-ID> which is also created previously
   
    Tick <Default> option to receive notifications from alerts which are configured on the grafana
   
    Tick <Include image> option to get notifications with graphical illustration of your grafana panels. Grafana image renderer is required to get graphical sample and it’s already installed as well as set up on the ethereum2-docker-compose
    
    Click on <Test>. All goes well, then you will get test message on the telegram app.
   
    Click on <Save>! 
    
 The Telegram notification channel is configured and saved on the grafana and you’ll get notifications from grafana on your telegram
