Alertmanager configuration for Telegram

1,967 views
Skip to first unread message

jjdiazgarcia

unread,
Sep 26, 2022, 7:00:17 AM9/26/22
to Prometheus Users
Hello everybody,

I am trying to send alerts to Telegram from Alertmanager but I am getting below error:

ts=2022-09-26T10:40:11.512Z caller=notify.go:732 level=warn component=dispatcher receiver=telegram integration=telegram[0] msg="Notify attemp failed, will retry later" attempts=1 err="telebot: invalid character '<' looking for beginning of value"

I have configured alertmanager as official doc says but I am not able to get alerts from my telegram bot.

This is the configuration of alertmanager.

receivers:
- name: telegram
  telegram_configs:
  - api_url: <private_bot_url>
    bot_token: <private_token>
    chat_id: <private_chat_id>
    message: Test telegram receiver
    send_resolved: True

I am using my custom bot. I am not using the official telegram api url with webhook configuration. I have a python script that sends to telegram the same message that is sent to it.

Does anyone know what could be the problem?

Thanks in advance.

Julius Volz

unread,
Sep 27, 2022, 8:33:55 AM9/27/22
to jjdiazgarcia, Prometheus Users
Since you are using your custom code, it's hard to say what exactly is happening, but the error message you posted is a common one in case a JSON parser tries to decode something that looks more like XML or HTML (it's complaining about the body starting with a "<" rather than something that looks like valid JSON). Maybe you mixed up JSON and XML/HTML somewhere?

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/5fe3ab1d-bfa2-4d21-b05f-9db5f2388e5fn%40googlegroups.com.


--
Julius Volz
PromLabs - promlabs.com
Reply all
Reply to author
Forward
0 new messages