> For the complete documentation index, see [llms.txt](https://help.sleuth.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sleuth.io/sleuth-dora/integrations-1/impact-sources/incident-tracker-integrations/custom/grafana-oncall.md).

# Grafana OnCall

If you are using Grafana OnCall to manage your alerts, you can use its Outgoing Webhooks feature to send data directly to a Custom Incident Impact Source in Sleuth.

{% hint style="info" %}
Please note that this is just one possible scenario on how you could use Grafana to feed Incident information to Sleuth. If you have a different process, you might need to adjust the steps/settings.
{% endhint %}

## Registering a new Incident

Within your **Grafana OnCall** dashboard, navigate to the **Outgoing webhooks** page and click **+ New Outgoing Webhook**:

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FkKE5awRdG7JKeAREGE05%2Fimage.png?alt=media&amp;token=2d7f8c16-3a2f-4860-8163-8cc821945c52" alt=""><figcaption></figcaption></figure>

In the next step, select **Advanced** to ensure you can customize your webhook as much as possible:

* Provide a (*preferably descriptive*) name for your webhook, e.g. `Sleuth - New Incident`.
* Select a **Trigger Type** from the dropdown. For the purpose of this example, we're choosing `Alert Group Created`.
* Set the **HTTP Method** to `POST`.
* Copy the **Impact registration POST URL** from Sleuth's Custom Impact Source setup modal and paste it into the **Webhook URL** field in Grafana.
* Enter the following into the **Webhook Headers** field in Grafana:

  ```json
  {
    "Content-Type": "application/json"
  }
  ```
* Specify the **Data** you want Grafana to send Sleuth, leveraging the 5 fields the impact registration endpoint is currently able to accept:

  ```json
  {
    "type": "triggered",
    "id": "{{alert_group_id}}",
    "title": "{{alert_payload.oncall.message}}",
    "date": "{{alert_group.created_at}}",
    "url": "{{alert_group.permalinks.web}}"
  }
  ```

{% hint style="warning" %}
Please make sure to **deactivate** **the** `Forward All` **toggle** to ensure only your custom payload is sent to Sleuth's impact registration endpoint.
{% endhint %}

## Closing an Incident

The process is mostly the same as for registering a new Incident, with the difference being the **Name** of the webhook, the **Trigger Ty**pe, which needs to be set to `Resolved`, and the content of the **Data** field, which only needs to contain the following:

* Provide a (*preferably descriptive*) name for your webhook, e.g. `Sleuth - Incident Resolved`.
* Select a **Trigger Type** from the dropdown. For the purpose of this example, we're choosing `Resolved`.
* Set the **HTTP Method** to `POST`.
* Copy the **Impact registration POST URL** from Sleuth's Custom Impact Source setup modal and paste it into the **Webhook URL** field in Grafana.
* Enter the following into the **Webhook Headers** field in Grafana:

  ```json
  {
    "Content-Type": "application/json"
  }
  ```
* Specify the **Data** you want Grafana to send Sleuth, leveraging the 5 fields the impact registration endpoint is currently able to accept:

  ```json
  {
    "type": "resolved",
    "id": "{{alert_group_id}}",
    "title": "{{alert_payload.oncall.message}}",
    "date": "{{alert_group.created_at}}",
    "url": "{{alert_group.permalinks.web}}"
  }
  ```

{% hint style="warning" %}
Please make sure to **deactivate** **the** `Forward All` **toggle** to ensure only your custom payload is sent to Sleuth's impact registration endpoint.
{% endhint %}

{% hint style="info" %}
Both above examples use Grafana's response's default data structure to extract data that correspond to fields for Sleuth's custom incident events. The only mandatory field **is`type`**, all others are optional and can thus be omitted from the response definition.

Without a unique identifier in both payloads, however, Sleuth will not be able to match the **`triggered`** and **`resolved`** events belonging to the **same incident**, and upon receiving a webhook with `resolved`, will **resolve all active Incidents** for that impact source.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sleuth.io/sleuth-dora/integrations-1/impact-sources/incident-tracker-integrations/custom/grafana-oncall.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
