> ## Documentation Index
> Fetch the complete documentation index at: https://docs.warrn.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Grafana

> Receive alerts from Grafana Alerting via webhook.

| Property         | Value    |
| ---------------- | -------- |
| **Type**         | Incoming |
| **Level**        | Service  |
| **Auto-resolve** | Yes      |

Grafana sends alert notifications to Warrn via a webhook contact point. When an alert fires in Grafana, Warrn creates an alert. When it resolves in Grafana, Warrn auto-resolves the matching alert.

## Setup

<Steps>
  <Step title="Add the integration in Warrn">
    Open a service or team in Warrn. Go to the **Integrations** tab, add **Grafana**, and copy the generated webhook URL.
  </Step>

  <Step title="Create a contact point in Grafana">
    In Grafana, go to **Alerting > Contact Points**. Click **Add contact point**, select **Webhook** as the type, and paste the webhook URL from Warrn.
  </Step>

  <Step title="Assign to a notification policy">
    In Grafana, go to **Alerting > Notification Policies**. Assign your new contact point to the alert rules you want routed to Warrn.
  </Step>
</Steps>

## How it works

Grafana sends a JSON payload containing an array of alerts. Each alert has a `status` field (`firing` or `resolved`).

* **Firing alerts** create a new alert in Warrn. If a matching alert already exists (same fingerprint), it increments the occurrence count instead.
* **Resolved alerts** auto-resolve the matching Warrn alert by fingerprint.

### Field mapping

| Grafana field                               | Warrn field                                   |
| ------------------------------------------- | --------------------------------------------- |
| `labels.alertname` or `annotations.summary` | Alert name                                    |
| `annotations.description`                   | Description                                   |
| `labels.severity`                           | Severity (mapped, see below)                  |
| `fingerprint`                               | Alert alias (used for dedup and auto-resolve) |
| `labels.*`                                  | Tags                                          |

### Severity mapping

Warrn maps the `severity` label from your Grafana alert rules:

| Grafana label                           | Warrn severity |
| --------------------------------------- | -------------- |
| `critical`, `disaster`, `emergency`     | critical       |
| `high`, `error`, `major`                | high           |
| `warning`, `medium`                     | medium         |
| `low`, `info`, `informational`, `debug` | low            |
| (no label or unrecognized)              | medium         |

<Note>
  Add a `severity` label to your Grafana alert rules for accurate mapping. Without it, all alerts default to medium.
</Note>
