# Grafana

Connect your Grafana instance to give Herald’s SRE agent real-time access to your observability data. During incident investigations, the agent can query metrics, logs, and database data across all datasources configured in your Grafana environment.

**The agent can:**

- Query Prometheus metrics using PromQL
- Query Loki logs using LogQL
- Query InfluxDB metrics using InfluxQL (v1) or Flux (v2)
- Query MySQL and PostgreSQL databases (including PlanetScale and TimescaleDB) using SQL
- List all available datasources and discover their UIDs
- Browse dashboards and inspect the queries behind individual panels

| Parameter | Description |
| --- | --- |
| **Grafana Base URL** | The base URL of your Grafana instance, without a trailing slash (e.g., `https://your-company.grafana.net`). |
| **Service Account Key** | A Grafana service account token with read access. Create one under **Administration > Service Accounts** in your Grafana dashboard. |

**Optional parameters**

| Parameter | Description |
| --- | --- |
| **Cloudflare Access Client ID** | Required only if your Grafana instance is protected by Cloudflare Access. Enter the service token client ID from Cloudflare Access. |
| **Cloudflare Access Client Secret** | Required if _Cloudflare Access Client ID_ is set. Enter the corresponding service token secret from Cloudflare Access. |
| **Rules / Instructions** | Free-form instructions that guide the agent on how to use this integration (e.g., "Only query the production Prometheus datasource" or "Focus on the payments service when diagnosing latency issues"). |
