Closed lazbord closed 3 months ago
How did you made it works
In Alertmanager config file, you have to group by alertname AND job, like so :
route:
group_by: ['alertname','job']
group_wait: 30s
group_interval: 5m
repeat_interval: 1h
receiver: 'discord_webhook'
receivers:
- name: 'discord_webhook'
webhook_configs:
- url: 'https://discordapp.com/api/webhooks/1247133913369940038/discordwebhooktoken'
are you sure, bec. i did have the same config as you mentioned but didn't work for me however the solution for me was running 1 more container for the discord integration for more.
https://github.com/evanugarte/prometheus-monitoring-tutorial https://github.com/benjojo/alertmanager-discord
discord-alerts:
image: benjojo/alertmanager-discord
container_name: discord-alerts
restart: unless-stopped
environment:
DISCORD_WEBHOOK: <discord_hook>
ports:
- "9094:9094"
Honestly, since the problem was resolved, I haven't touched a single config file. Good thing if your solution works!
What did you do?
I tried to triggered my discord webhook when an alert is firing. I tested my discord webhook with curl and it work just fine :
curl -X POST -H "Content-Type: application/json" -d '{"content": "Another test!"}' https://discord.com/api/webhooks/discordwebhooktoken
Prometheus and Alermanager do recognize the alert :
Everything seemed to work but i don't have any messages in my discord channel when an alert is firing.
Here is the log from alertmanager :
I have tried to resolve this issue by specifying template that specifies a message but it doesn't change a thing.
I'm a newbie so maybe I miss something out, but I believe I have done everything correctly...
Alertmanager version:
version=0.27.0
Prometheus version:
version=2.52.0-rc.1
Alertmanager configuration file:
*alert-rules.yml :