cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Integrating Dynatrace notification with Telegram

Hi,

We want to integrate Dynatrace notifications with Telegram.

I think this can be done via Webhook.

I've seen this link https://hevodata.com/learn/telegram-webhooks/#s7 in which it seems it's possible to do that. But I have some questions about the implementation.

1.- On "Step1" on the link, it says that the first step in setting up Telegram Webhooks Integration is to obtain the Authorization Token.

So I guess we have to input that token clicking on "Creating basic authorization header". Am I right?

 

erh_inetum_1-1649337603089.png

 

2.- I have doubts about what is the Webhook URL that we have to configure.

Reading the link, on step 4 it seems we have to put the Telegram Bot API URL. And a Telegram Bot API must be created to send notifications. So I guess we have to put Telegram Bot API URL on Webhook URL field in Dynatrace. Is that the case?

 

3.- And about the payload,  I think it is clear this part for me: we should send the fields we want to be notified via Telegram. So, I have no doubts about this.

 

Has someone implemented that? Could someone help me?

 

Regards,

Elena.

 

4 REPLIES 4

Julius_Loman
DynaMight Legend
DynaMight Legend

Hello @erh_inetum ,

actually ,you need to get familiar with how the bots work in telegram. This was always quite challenging to setup, but you can find guides for it. I don't use telegram anymore, but this one below works for me. 


URL is: https://api.telegram.org/bot<your_bot_token>/sendMessage
POST Method
JSON notification payload: 

{ "chat_id": <your_chat_id>, "text": "<text_message>" }


Just replace:

  • <your_bot_token> with bot token
  • <chat_id> with the chat ID where you are about to send message to
  • <message> with the message text

 

Optionally you can send also markdown or HTML formatted messages, see telegram API docs.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

I keep receiving an error, shown below... I am not sure what the issue is here... i have followed the above correctly and confirmed i have the correct token... and suggestions on how to resolve this? 

"Custom Integration test failed

Reason: Could not connect to the specified URL"

 

Regards,

Kishan

@Kishan are you using Dyntrace Managed or SaaS? With Managed most likely your outbound connections from the cluster nodes to the URL are not allowed. 

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Kishan
Observer

It is a managed solution thank you... I have confirmed the firewall wasnt opened when requested. 

 

Featured Posts