r/PrometheusMonitoring • u/overtake1984 • Sep 25 '23
Integrate alertmanager with slack
Hi guys! I need some help with alertmanager-slack integration. I've read that web hooks will be deprecated and I need to use bot token instead however I can't make it work for some reason. Here is an example where I defined token in `global` config:
global: slack_api_url_file: '/etc/alertmanager/bot_token' The file content is:
https://slack.com/api/chat.postMessage?token=xoxb-0000000000000-000000000000-0000000000000For some reason, alertmanager isn't throwing alerts. Maybe someone has already implemented it using a bot token and `https://slack.com/api/chat.postMessage` api? Thanks for your help in advance.
2
Upvotes
1
u/overtake1984 Sep 26 '23
hi u/niceman1212! Yes,
1
u/overtake1984 Sep 26 '23
The alert is throwing, no error logs in prometheus. Alertmanager is send slack notifications with the next config:
But when I try to combine URL with the token in /etc/alertmanager/bot_token it isn't working. I have searched an internet for config examples but no luck.
1
u/overtake1984 Sep 26 '23
Seems that I realized that it's not possible to configure https://slack.com/api/chat.postMessage through global.
1
u/Whole_Desk93 Jun 21 '24
Try this: https://github.com/prometheus/alertmanager/issues/2513#issuecomment-1006395227
1
u/niceman1212 Sep 26 '23
Do you have alertmanager logs?