Prometheus Alertmanager
Alertmanager sends each group of alerts to a webhook receiver as JSON. Point one at a Pocketbell webhook Source: Pocketbell knows Alertmanager’s events, so there’s nothing to write.
Set it up
Section titled “Set it up”-
In the Pocketbell app, create a Source named Alertmanager, choose Webhook, and copy its URL.
-
Add a receiver to
alertmanager.yml, and route alerts to it:route:receiver: pocketbellgroup_by: [alertname]receivers:- name: pocketbellwebhook_configs:- url: https://api.pocketbell.dev/v1/hooks/pbw_…send_resolved: true -
Reload Alertmanager, and let an alert fire, or send a test one:
Terminal window amtool alert add alertname=PocketbellTest severity=warning \--annotation=summary="Test from Alertmanager" \--alertmanager.url=http://localhost:9093 -
It arrives as DiskFull is firing, or DiskFull is firing (3) for a group of three, with the alert’s
summaryannotation as the message, and a button to Prometheus when its address is one your phone can open. The Source’s setup shows the event and its Preview.
How it behaves
Section titled “How it behaves”- Severity sets the priority, with the Source’s default priority left on
Normal (any other default makes every event that priority): a group whose
severitylabel iscritical(orpage) is Critical, repeating until you acknowledge it, for up to an hour; any other firing group is Important. Resolved arrives as “DiskFull resolved”, starting “Firing for 12 min”, and stops the alert repeating; both stay in the inbox, in order. - Alertmanager sends a group of alerts at once.
group_by: [alertname]keeps one name per group, which is the title. - To change any of it, set your own title, message or priority in the
Source’s setup: what you set wins, part by part.
{{groupLabels.alertname}}and{{commonAnnotations.summary}}hold what every alert in a group shares, and{{alerts.0.labels.instance}}reads the first alert. More in Webhooks.