> For the complete documentation index, see [llms.txt](https://docs.pagerly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagerly.io/sre-ai-agent/data-sources/grafana.md).

# Grafana

## What the Agent Can Do

* Search and list dashboards by name, tag, or folder
* Query Prometheus metrics through the Grafana datasource proxy
* List and search annotations — find deployment markers, incident notes
* Get datasource information

## Setup Instructions

1. Log into your **Grafana instance**
2. Go to **Administration** (gear icon) > **Service accounts**
3. Click **Add service account**, give it a name (e.g., `Pagerly`)
4. Set the role to **Viewer** (or **Editor** if you need annotation access)
5. Click **Add service account token**, then **Generate token**
6. Copy the token and paste it below along with your Grafana URL

## Required Credentials

| Field           | Description                   | Example                        |
| --------------- | ----------------------------- | ------------------------------ |
| **API Token**   | Grafana service account token | `glsa_...`                     |
| **Grafana URL** | Your Grafana instance URL     | `https://your-org.grafana.net` |

## Context Prompt Tips

> *"Our main dashboards are in the SRE folder. We use Prometheus for metrics. Key dashboards: api-latency, error-rates, k8s-overview."*

## Docs

* [Grafana HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/)
