alertmanager
alertmanager copied to clipboard
Wants alerting to subgroups in telegram
In one of updates of Telegram messanger added subgroups to group chats.
Please add possibility send messages to subgroups. For will made this need add one field message_thread_id
in request for Telegram Bot API.
Thanks
Just add message_thread_id field to <telegram_config> (https://prometheus.io/docs/alerting/latest/configuration/#telegram_config)
Just add message_thread_id field to <telegram_config> (https://prometheus.io/docs/alerting/latest/configuration/#telegram_config)
why should it work if its undocumented? It doesnt seem like a field that would automatically work? :{
@udartsev it does not work as you suggested.
alertmanager config:
telegram_configs:
- send_resolved: false
chat_id: -1001868435535
message_thread_id: 1486
image: prom/alertmanager:v0.26.0
Error log:
ts=2023-11-08T14:53:42.575Z caller=coordinator.go:118 level=error component=configuration msg="Loading configuration file failed" file=/etc/alertmanager/alertmanager.yml err="yaml: unmarshal errors:\n line 39: field message_thread_id not found in type config.plain"
not surprising, since it's not documented.
Upvote for this feature, but currently theres no per-topic policies in telegram, such as 'send message' to prevent user messaging in topics planned for alerts. w8ing for yr experience, but seems writing yet another bot paired with alertmanager webhooks is unavoidable to achieve functionality i ve mentioned
Alertmanager may have already implemented this, I'll check it separately on the latest version. But I found an article (in Russian) in which a person modifies the internal code of Alertmanager to add support for message_thread_id to the function of sending messages to TG. https://nixhub.ru/posts/alertmanager-to-tg-topics/ I plan to try to make my own build with these changes in the container. PS. I find allready modifed alertmanager for supergroup tg - https://github.com/oktend/alertmanager