# Grafana Integration

### Overview

[Grafana](https://grafana.com/) is an open-source analytics and observability platform widely used for monitoring metrics, logs, and traces. By configuring a Webhook contact point in Grafana Alerting, you can forward firing and resolved alerts directly to ITOC360 and trigger your on-call escalation policies in real time.

### Provider Configuration & Mapping

ITOC360 uses the `status` field from Grafana's webhook payload to determine the alert type.

| Grafana Status | ITOC360 Type |
| -------------- | ------------ |
| `firing`       | ALERT        |
| `resolved`     | RESOLVE      |

Priority is read from the `severity` label on your Grafana alert rule. The supported values and their mappings are:

| Grafana Severity Label | ITOC360 Priority |
| ---------------------- | ---------------- |
| `info`                 | LOW              |
| `warning`              | MEDIUM           |
| `critical`             | CRITICAL         |

To use priority mapping, add a `severity` label to your Grafana alert rule with one of the values above. If no severity label is present, the alert will default to MEDIUM priority.

***

### Setup Instructions

**Step 1: Get Your Webhook URL**

1. Log in to your ITOC360 platform.
2. Go to **Sources → Add Source**.
3. Select **Grafana** as your provider.
4. Save the configuration and copy the generated **Webhook URL** and **Token**.

**Step 2: Open Notification Configuration**

1. Log in to your Grafana instance.
2. From the left sidebar, go to **Alerts & IRM → Alerting → Notification configuration**.
3. Make sure you are on the **Contact points** tab.

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2F1SYQ0IjN28rliK3UylGX%2Fimage.png?alt=media&#x26;token=d1074149-1069-479c-850b-d5eb62800f5e" alt=""><figcaption></figcaption></figure>

**Step 3: Create a Contact Point**

1. Click **+ New contact point** in the top right corner.
2. Fill in the form:
   * **Name:** `itoc360`
   * **Integration:** Select `Webhook` from the dropdown.
   * **URL:** Paste your webhook URL in the following format:

     ```
     https://api.itoc360.app/functions/v1/events
     ```
   * **HTTP Method:** `POST`
   * **Extra Headers:**`x-itoc360-token`
3. Leave all other fields as default.

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FqRtXKK5a4R4sBeWhYo87%2Fimage.png?alt=media&#x26;token=2552877c-e50c-47f3-a1a0-7942673b204c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FC8Y9j4E6OadoUw1H5FaO%2Fimage.png?alt=media&#x26;token=80a72ee6-86dc-403e-b734-f33ad0b7fccb" alt=""><figcaption></figcaption></figure>

**Step 4: Test the Contact Point**

1. Click the **Test** button in the top right of the form.
2. A dialog will appear — click **Send test notification**.
3. A green **Test notification sent successfully** message confirms the payload reached ITOC360.

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2F2pJa8eAKynYvHflXxp9X%2Fimage.png?alt=media&#x26;token=2e292961-eca8-414b-bf45-3a7ea0725568" alt=""><figcaption></figcaption></figure>

4. Click **Save contact point**.

**Step 5: Set as Default Notification Policy**

1. Switch to the **Notification policies** tab.
2. On the **Default policy** row, click **More → Edit**.
3. In the **Edit route** dialog, click the **Default contact point** dropdown and select `itoc360`.

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FJrXRJAzOgXGNZKhTm9eo%2Fimage.png?alt=media&#x26;token=56b955d1-9e95-426b-b3d3-430eae2bc3d1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FNMIEu9eC8uWXBKggjEol%2Fimage.png?alt=media&#x26;token=c67ef2cc-dc29-4eff-ac7a-0086e1ceb5bc" alt=""><figcaption></figcaption></figure>

4. Click **Update policy**.

From this point on, all firing alerts in Grafana will be routed to ITOC360. Each alert rule you create will automatically notify your on-call team based on your escalation policies.
