grafana-dashboards

Query Grafana dashboards, Prometheus metrics, and alerts via the Grafana API.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill grafana-dashboards-erwinv2k-tkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grafana-dashboards
Source: https://github.com/erwinv2k-TKG/AgentesVSC/tree/main/packs/incidentfox/sre-agent/.claude/skills/observability-grafana
Command: npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill grafana-dashboards-erwinv2k-tkg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires httpx, and includes scripts (resource) components.

What problem does it solve? Investigating production issues often requires manually clicking through Grafana dashboards, writing PromQL by hand, and checking alert states across multiple screens. This Skill automates those steps by letting an AI agent query Grafana directly through its API. ## Core Features & Use Cases - Dashboard Discovery & Inspection: Search dashboards by keyword and retrieve panel details by UID. - Prometheus Metrics Queries: Run PromQL range queries through Grafana with automatic Prometheus datasource detection. - Alert Review & Dashboard Creation: List active alerts (unified or legacy alerting) and create dashboards from pre-built JSON templates like the Vercel overview. - Use Case: During an incident, ask the agent to check active alerts, query the 5xx error rate for a service over the last hour, and pull the relevant dashboard panels to correlate the spike. ## Quick Start Ask the agent to list active Grafana alerts and query the HTTP error rate for your API service over the last 60 minutes.

Frequently Asked Questions about grafana-dashboards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Prometheus metrics through Grafana?

Run query_prometheus.py with a PromQL expression, an optional time range in minutes, and a step interval. The script auto-detects the Prometheus datasource ID, or you can pass --datasource-id explicitly after listing datasources.

How do I list and search Grafana dashboards from the command line?

Use list_dashboards.py with an optional --query flag to search dashboards by keyword. It returns up to 50 dashboards with their UID, title, folder, and tags, which you can then inspect with get_dashboard.py.

Does this work with Grafana Cloud unified alerting?

Yes. The get_alerts.py script first tries the unified alerting API used by Grafana Cloud and Grafana 9+, then falls back to the legacy /api/alerts endpoint for older Grafana versions.

Why is GRAFANA_API_KEY not visible in environment variables?

Credentials are injected transparently by a proxy layer, so the API key never appears in the environment. You only need to set GRAFANA_URL or GRAFANA_BASE_URL and run the scripts directly.

Can I create Grafana dashboards from JSON templates?

Yes. create_dashboard.py accepts a dashboard JSON template, overrides the title, and posts it to the Grafana API. It supports targeting a folder by UID and overwriting existing dashboards with the same title.