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

# Grafana Integration

> Integrate Annie with Grafana for unified observability and intelligent investigation.

<iframe width="560" height="315" src="https://www.youtube.com/embed/QIQFILg7wfU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

# Grafana Integration

Grafana integration enables Annie to ingest logs, metrics, and alerts (alert rules and their firing instances), providing a unified, intelligent view of your infrastructure's health and performance.

## Setup Guide

1. Create a Grafana [service account and token](#create-a-grafana-service-account) with the required roles
2. Go to the [Anyshift Grafana integration page](https://app.anyshift.io/integrations/monitoring/grafana)
3. Select **Grafana Cloud** or **Self-Hosted Grafana**
4. Enter your **Grafana Instance URL**
5. Enter a display name for the service account and paste the **Service Account Token**
6. Click **Save Grafana Configuration**

⚠️ Anyshift currently supports one Grafana integration per account. Contact us if you need multiple instances supported.

### 1. Grafana Instance URL

* For Grafana Cloud, enter your stack name only (for example `your-org`). Anyshift builds `https://your-org.grafana.net` for you.
* For self-hosted, use your public or internal Grafana URL (for example `https://grafana.example.com`)

### 2. Service Account & API Token

Annie authenticates with a Grafana **service account token** (it starts with `glsa_`). Do not use a personal API key or a Grafana Cloud Access Policy token.

#### Create a Grafana service account

You need Grafana organization Admin permissions (or equivalent service-account creator roles) in the instance you are connecting.

1. Sign in to the Grafana instance you want to connect (for Grafana Cloud, open your stack at `https://your-org.grafana.net`, not only the Grafana.com portal)
2. In the left menu, go to **Administration → Users and access → Service accounts**
3. Click **Add service account**
4. Enter a display name such as `anyshift-readonly`
5. Set the basic role to **Viewer**
6. Click **Create**

#### Add the Alerting provisioning role

A plain **Viewer** can query dashboards and data sources, but cannot read alert rules through the provisioning API that Anyshift uses (`/api/v1/provisioning/alert-rules`).

1. Open the service account you just created
2. In the role picker / Fixed roles section, add **Alerting:Read via Provisioning API + Export Secrets** (`fixed:alerting.provisioning.secrets:reader`)
3. Click **Update**

Anyshift only reads alert rule definitions. It does not call Grafana's export-with-decrypted-secrets endpoints. Grafana nevertheless packages that capability into this fixed role, so treat the token like any other credential that could reach alerting contact-point secrets if misused. On Grafana Cloud or Enterprise you can instead create a custom role with only `alert.provisioning:read` if you want to avoid the secrets permission.

If your Grafana edition does not expose that fixed role, assign **Alerting provisioning writer** (`fixed:alerting.provisioning:writer`) instead. That grants write access to alert rules; Anyshift still only reads them.

#### Create a service account token

1. Still on the service account page, click **Add service account token**
2. Enter a token name such as `anyshift`
3. Optionally set an expiration date
4. Click **Generate token**
5. Copy the token immediately and store it securely. Grafana shows it only once.

Paste that token into Anyshift as the **Service Account Token**. The **Service Account Name** field in Anyshift is a label for your team; it does not need to match the Grafana display name exactly.

## How It Works

Once connected, Anyshift automatically ingests logs, metrics, and alerts from Grafana. When an incident occurs, Annie’s AI agent:

* Correlates Grafana logs and metrics with your resource graph
* Traces request chains across services
* Surfaces root causes and actionable insights
* Reduces the need to manually jump between dashboards

**Anyshift + Grafana = Observability superpowers.**

Ready to get started?
