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

# Grafana

The Grafana Cloud integration can be configured via Grafana Cloud's and Resolve's UIs.

<Info>
  **Self-Hosted Grafana?** If you're running Grafana in your own infrastructure, you'll need to use the [Resolve Satellite](/resolve-satellite). See the [Grafana On-Prem](/grafana-on-prem) setup guide for instructions.
</Info>

## Create a Service Account Token

To access your Grafana environment a service account token is needed. If you don’t already have a service account, please create one: [How to create a service account](https://grafana.com/docs/grafana/latest/administration/service-accounts/#create-a-service-account-in-grafana).

There are two options for creating your service account token.

<Accordion title="Option 1: Create a token via the UI [Recommended]">
  Official documentation: [How to add a token to a service account in Grafana](https://grafana.com/docs/grafana/latest/administration/service-accounts/#add-a-token-to-a-service-account-in-grafana)
</Accordion>

<Accordion title="Option 2: Create a token via the API">
  If you are running Grafana Enterprise, for some endpoints you might need to have specific permissions. Refer to [Role-based access control permissions documentation](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/access-control/custom-role-actions-scopes/) for more information. For Grafana Cloud instances, you can use a Bearer token to authenticate.

  #### Create a Service Account through the API

  Official documentation: [How to create to Grafana service account via API](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#create-service-account)

  Run the following command. Please ensure that you replace the following properties:

  * **grafana-instance:** Your Grafana endpoint
  * **auth-api-key:** Your authorization token for accessing the API (if applicable).

  ```shell create service account api theme={null}
  curl -X POST http://<grafana-instance>/api/serviceaccounts \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <auth-api-key>" \
  -d '{"name":"resolve-service-account", "role":"Viewer",
  "isDisabled": false}'
  ```

  The response will include the new Service Account ID. Please take a note of it.

  ```json create service account api response theme={null}
  { "id": 1, "name": "resolve-service-account", "isDisabled": false, .... }
  ```

  #### Create a token for your Service Account via the API

  Official documentation: [How to create to Grafana service account token via API](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#create-service-account-tokens)

  Run the following command. Please ensure that you replace the following properties:

  * **grafana-instance:** Your Grafana endpoint
  * **id:** Your service account ID, for which a token will be created
  * **auth-api-key:** Your authorization token for accessing the API (if applicable)

  ```shell theme={null}
  curl -X POST http://<grafana-instance>/api/serviceaccounts/<id>/tokens \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <auth-api-key>" \
  -d '{"name":"resolve-access-key", "role":"Viewer"}'
  ```

  The response will include the new API key. Securely store this key immediately, as it won't be displayed again.

  ```json token creation api response theme={null}
  {"id":1,"name":"resolve-access-key","key":"eyJrIj**********************"}
  ```
</Accordion>

## Configure the Grafana Integration in the UI

1. Sign in to ResolveAI and open the Grafana integration page [https://app0.resolve.ai/integrations/grafana/connect](https://app0.resolve.ai/integrations/grafana/connect)
2. Click **Add Connection** and set up a new integration:
   * **Token:** Generated in the previous step
   * **URL:** The endpoint for your Grafana instance

## Send alerts to ResolveAI via webhook

If you use Grafana for alerts, use webhooks to send alert events to ResolveAI.

1. Sign in to ResolveAI and open the Grafana integration page [https://app0.resolve.ai/integrations/grafana/connect](https://app0.resolve.ai/integrations/grafana/connect)
2. Inside your Grafana integration, scroll down and click **Edit**
3. Scroll down to **Webhooks** and click **+** icon to add a new webhook token
4. Enter a **Name** and click **Save**
5. Auto-generated instructions will show in the UI, to guide you through the steps in Grafana.

## Mitigation Actions (Optional)

If your organization uses Resolve's [Mitigation Actions](/mitigation-actions) to silence alerts during investigations, your service account needs additional permissions beyond the default Viewer role.

<Info>
  This section only applies if you have enabled [Mitigation Actions](/mitigation-actions). The default Viewer role is sufficient for investigation.
</Info>

* **Grafana v11+**: Add the `alert.provisioning:write` RBAC permission to your service account. See [Grafana RBAC permissions](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/access-control/custom-role-actions-scopes/) for details.
* **Older versions**: Use the `Admin` role instead of `Viewer` for the service account.

After updating, verify the integration health check still passes in the Resolve UI.

## FAQ

#### **What Grafana Data Sources can Resolve connect to?**

Resolve integrations include support for Tempo, Loki, Prometheus, Mimir, Alert Manager, Elasticsearch, Clickhouse, SolarWinds, Pyroscope, and all supported plugins.
