# Grafana

EvoHub receives alerts from Grafana Alerting through a **Webhook** contact point. Each firing alert opens an EvoHub alert, and Grafana's resolved notification resolves it.

## Set it up

:::steps
### Create the integration
In EvoHub, go to **On-Call → Integrations → + Add Integration**, choose **Grafana**, pick an **Escalation Policy** and click **Create Integration**. Copy the **Webhook URL**.
### Add a contact point in Grafana
In Grafana, go to **Alerting → Contact points → Add contact point**. Choose the **Webhook** integration, paste the URL into **URL** and keep **HTTP Method** as **POST**. Save.
### Use it in a notification policy
In **Alerting → Notification policies**, send the alerts that should page to the new contact point — as the default policy or a nested policy matching specific labels.
:::

Grafana sends resolved notifications by default, so auto-resolve works without extra settings (unless you turned on **Disable resolved message** on the contact point).

You can use Grafana's **Test** button on the contact point to check the connection; it sends a test notification that opens a test alert in EvoHub.

## What EvoHub reads

Grafana can send several alerts in one notification. EvoHub handles each alert separately:

| EvoHub alert | Taken from |
| --- | --- |
| Title | The alert's `alertname` label, otherwise the notification title. |
| Description | The `summary` annotation, otherwise the notification message. |
| Severity | The `severity` label — see below. |
| Labels and annotations | All of the alert's labels and annotations. |
| Fingerprint | Grafana's fingerprint for the alert (or one computed from its labels). |

### Severity

Add a `severity` label to your Grafana alert rules to control urgency:

| `severity` label | EvoHub severity |
| --- | --- |
| `critical` | critical |
| `high`, `warning` | high |
| `low` | low |
| `info` | info |
| anything else, or missing | medium |

## Resolve and deduplication

- A `firing` alert opens an EvoHub alert. Repeat notifications for an alert that is still open are recorded as **Retriggered**, and nobody is paged again.
- A `resolved` alert resolves the matching EvoHub alert.
- Alerts with different label sets are different alerts. A multi-dimensional rule (for example one alert per host) opens one EvoHub alert per host.

## Troubleshooting

- **Contact point test fails with 401**: the key in the URL is wrong, or the integration is disabled in EvoHub.
- **Alerts never resolve**: check that resolved messages are not disabled on the contact point.
- **Alert arrives but nobody is paged**: check the integration's escalation policy and who is on call.

## Related

- [Integrations overview](https://docs-dev.evohub.io/integrations-overview.md)
- [Prometheus Alertmanager](https://docs-dev.evohub.io/prometheus-alertmanager.md)
- [Escalation policies](https://docs-dev.evohub.io/escalation-policies.md)
