Simple worker to proxy Grafana webhook requests to Discord in a more concise format. Not extensively tested or comprehensive.
- Deploy this worker to Cloudflare Workers
- Create a new webhook in Discord
- Generate a random secret key (e.g. 24 characters) and create a new environment variable in the worker called
TOKEN_1
. The value should be the secret key, followed by a comma (,
), followed by the Discord webhook URL. For example:TOKEN_1=secretkey,https://discord.com/api/webhooks/1234567890/ABCDEFGHIJKLM
- Create as many more tokens as you need, e.g.
TOKEN_2
,TOKEN_3
, etc. Each one can route to a different Discord webhook. - In Grafana, go to Alerting → Contact points → Add contact point
- Integration: Webhook
- URL:
https://grafana-discord-worker.yourusername.workers.dev/webhook
- HTTP method: POST
- Authorization Header - Scheme: Bearer
- Authorization Header - Credentials: The secret key you created in step 3
- Test the contact point, and save it when there are no problems.
The description of the alert will use the summary of the alert, or the description if it is not available. No other information is currently shown.
MIT