Grafana Integration
Connect Grafana to enable agents to query dashboards, metrics, and alerts during investigations. You can also forward Grafana alerts to Autoheal via webhook so alerts are ingested, grouped, and available for triage in the Alerts page.
Capabilities
Once connected, agents can:
| Capability | Description |
|---|---|
| Query Logs | Query logs from Loki or VictoriaLogs data sources |
| Query Metrics | Fetch data from Prometheus and other metric sources |
| Query ClickHouse | Run read-only SQL against ClickHouse data sources that use the Altinity plugin |
| View Dashboards | Access dashboard panels and visualizations |
| Check Alerts | Review alert rules and their current state |
| Alert Source Webhooks | Receive Grafana firing and resolved alerts via webhook, including batched alert payloads |
| Search Annotations | Find annotations marking events |
Supported Log Backends
The Grafana integration auto-detects your log backend and uses the appropriate query tools:
| Backend | Datasource Type | Query Language | Auto-Detected |
|---|---|---|---|
| Grafana Loki | loki | LogQL | Yes |
| VictoriaLogs | victoriametrics-logs-datasource | LogsQL | Yes |
No additional configuration is needed. Agents discover available data sources automatically.
Query ClickHouse
Agents can run read-only SQL against ClickHouse data sources that use the Altinity plugin for ClickHouse (type vertamedia-clickhouse-datasource). Queries go through Grafana's data source proxy with the integration's token, so no separate ClickHouse credentials are needed.
Each query must be one SELECT, WITH, SHOW, DESCRIBE, EXPLAIN or EXISTS statement. Autoheal refuses anything else before it reaches Grafana, including functions that make ClickHouse read other hosts or files (url, s3, remote, file and similar).
Grafana's Viewer role doesn't limit the SQL that reaches ClickHouse. Any token that can query the data source reaches ClickHouse as the user configured on that data source. Make that ClickHouse user read-only, and grant it only the databases agents need.
Grafana's own ClickHouse plugin (grafana-clickhouse-datasource) isn't supported.
Prerequisites
- A Grafana instance (Cloud or self-hosted)
- Grafana 9+ with Unified Alerting enabled (required for alert-source webhooks)
- A Service Account token or a legacy API key
- Viewer or higher permissions
Setup
Both service account tokens (recommended) and legacy API keys are supported.