Skip to content

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.

  1. In the Pocketbell app, create a Source named Alertmanager, choose Webhook, and copy its URL.

  2. Add a receiver to alertmanager.yml, and route alerts to it:

    route:
    receiver: pocketbell
    group_by: [alertname]
    receivers:
    - name: pocketbell
    webhook_configs:
    - url: https://api.pocketbell.dev/v1/hooks/pbw_…
    send_resolved: true
  3. 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
  4. It arrives as DiskFull is firing, or DiskFull is firing (3) for a group of three, with the alert’s summary annotation 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.

  • Severity sets the priority, with the Source’s default priority left on Normal (any other default makes every event that priority): a group whose severity label is critical (or page) 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.