This tool allows receiving alerts from Grafana through an NTFY topic!
It’s a simple Cloudflare worker that handles converting a Webhook alert from Grafana to one, or more, requests to the NTFY service. It does little more than mapping an HTTP request from one shape into another.
When you get an alert, it could look something like this:
And when it gets resolved:
You can run your own by simply setting up a free Cloudflare account and deploying the worker code to it.
From my own testing this fits very comfortably in the free plan (which limits worker executions to 10ms CPU time). Requests are usually processed in under 3ms of CPU time.
Once you have your instance running, simply add a contact point in Grafana that points to it.
You can use the Test button to make sure it works 👍️
You can also use the following demo instance with the following URL:
https://grafana2ntfy.hctr.dev/alert/<topic-id>
Just replace <topic-id> with an NTFY topic you are subscribed to on ntfy.sh
PLEASE NOTE: I’m providing this for demo purposes, I make no promises around uptime or availability! I may change the service at any time without warning. Use at your own risk.
I have found that this is hitting rate limits on ntfy.sh, causing alerts to never be delivered.
This is likely to affect other deployments as well, since the issue appears to be Cloudflare’s shared IPs, not the traffic the particular worker is generating.
So this project may not be that reliable when using the main ntfy.sh instance (which is kind of important for this kind of thing) 🫠
The solution may be to set up a paid plan on NTFY, or self-host your own instance. I’ve gone with the option to self-host my own instance and that is working fine. You can configure a custom URL and, optionally, an authentication key when setting up the worker.