# Alertmanager and Grafana

> Route Prometheus Alertmanager or Grafana alerting through InfraInbox.

Web page: https://infrainbox.app/docs/sources/alertmanager/

Alertmanager (standalone, or the one bundled with Grafana's alerting) can call a webhook receiver directly. InfraInbox accepts its native payload, so nothing changes on the Prometheus or Grafana side beyond adding a receiver or contact point.

**Tested with:** Alertmanager 0.28, Grafana 11+.

## What you get

A firing alert opens an incident; the matching resolved notification closes it, matched by Alertmanager's own alert fingerprint. The shipped preset sets firing alerts to never auto-expire — only the resolved notification is trusted to close them, since Alertmanager already tracks that state for you.

## Prerequisites

- Alertmanager (or Grafana's alerting) able to reach your InfraInbox server over HTTPS.
- `send_resolved: true` on the receiver, or you'll never see an incident close on its own.

## Setup

### Alertmanager

1. Go to **Add source → Alertmanager** (dashboard screen `/sources/new/alertmanager`) and name it. Copy the issued ingest key.
2. Add a receiver to `alertmanager.yml` and route alerts to it:

   ```yaml
   receivers:
     - name: infrainbox
       webhook_configs:
         - url: https://infrainbox.example.com/hooks/alertmanager
           send_resolved: true
           max_alerts: 500
           http_config:
             authorization:
               credentials: iik_src_…
   ```

3. Reload Alertmanager and click through a route to `infrainbox`, or trigger a real alert to confirm.

### Grafana

1. Alerting → Contact points → Add contact point, integration **Webhook**.
2. Fill in:

   | Field | Value |
   |---|---|
   | URL | `https://infrainbox.example.com/hooks/alertmanager` |
   | HTTP Method | POST |
   | Authorization Header Scheme | Bearer |
   | Authorization Header Credentials | `iik_src_…` |

3. Click **Test**. The source shows **Reachable**.
4. Point a notification policy at the contact point.

## Check it works

Trigger an alert (or use Grafana's Test button) and confirm the source switches to **Receiving events** and an incident opens. Let the alert clear and confirm the incident resolves.

## Limitations

One InfraInbox source can take every Alertmanager or Grafana instance's alerts you want grouped the same way — split them into separate sources only if you want separate routing or separate presets.

## Next

- [Routing rules](https://infrainbox.app/docs/notifications/routing.md) — route by alert label or severity
- [Presets](https://infrainbox.app/docs/notifications/presets.md) — edit the shipped rule
