A toolkit for SRE engineers who build Grafana dashboards for production services.
GrafanaSmith is a curated collection of skills, templates, and conventions
for turning Prometheus scrape_configs and a short service description
into production-ready Grafana dashboards.
The centerpiece is the
grafana-dashboard skill — an
opinionated generator that knows the metrics, panels, and variables that
matter for the most common infrastructure components. The skill follows
the standard SKILL.md format and is engine-agnostic: it works in
opencode, Claude Code, Cursor, and any other agent
that can load a skill from a SKILL.md file.
Most Grafana dashboards in the wild suffer from the same problems:
- panels with no clear narrative (Golden Signals missing);
rate(node_cpu_seconds_total[5m])copy-pasted everywhere, even when the service is not a CPU-bound one;- hardcoded instance names instead of templated variables;
- thresholds picked at random, with no link to SLOs.
GrafanaSmith encodes the SRE best practices — RED, USE, Golden Signals — into a repeatable workflow so every dashboard you ship has the same shape and the same quality bar.
The skill accepts three inputs and produces a Grafana-compatible JSON dashboard:
| Input | Required | Description |
|---|---|---|
scrape_configs |
yes | Prometheus job definitions (job_name, static_configs, relabel_configs, metrics_path) |
service_description |
yes | What the service is and how it is deployed (single, cluster, primary-replica, sharded...) |
context |
no | Environment, expected load, SLO, presence of Alertmanager |
The skill operates in three modes:
- create — generate a new dashboard from scratch.
- iterate — refine an existing dashboard without rewriting it from scratch.
- composite — generate a single dashboard covering multiple services (e.g. PG+Redis+Kafka).
The skill ships with fourteen service templates under
skills/grafana-dashboard/templates/:
- PostgreSQL
- PostgreSQL HA (Patroni)
- MySQL / MariaDB
- Redis
- Redis Cluster
- Kafka
- NGINX
- Elasticsearch / OpenSearch
- MongoDB
- RabbitMQ
- PowerDNS Authoritative
- Node Exporter (generic host)
- Kubernetes Pods (kube-state-metrics + cAdvisor)
- Generic / unknown service (Golden Signals fallback)
Each template defines the panel sections, ready-to-use PromQL
expressions, alert thresholds, and template variables that make sense
for that service. Adding a new service is a matter of creating one
templates/<service>.md file following the same layout — no changes to
the skill itself.
Every dashboard produced by the skill includes:
- Overview row with Golden Signals (QPS, latency p99, error rate, saturation) as
statpanels. - Traffic / Queries row with time-series breakdowns by label.
- Saturation / Resources row (CPU, memory, disk, network when node_exporter is present).
- Errors & latency distribution row with heatmaps and p50/p95/p99.
- Topology row (when the service has a non-trivial topology).
- Templating variables:
$datasource,$job,$instance,$interval, plus profile-specific ones ($role,$datname,$topic,$consumergroup,$namespace, ...). - Optional: thresholds on critical panels, separate Prometheus alert rules for Alertmanager, deployment annotations.
The generated JSON follows modern Grafana conventions:
schemaVersion39 (Grafana 10), 40 (Grafana 11), 41 (Grafana 12), 42 (Grafana 13+ — final v1 schema);gridPosvalidated against the real grid rules (x + w <= 24, no overlaps);$__rate_intervalin allrate()windows (fixed[5m]only in alert rules);unitset on every panel (reqps,s,percentunit,bytes, ...);legendFormaton every series;- stable
uidconvention (<environment>-<service>-<purpose>); grafanaSmithmetadata block with version, template, template_version, mode, datasource_type, and generated_at — so the skill knows what version generated the dashboard when iterating later;- alert rules (PrometheusRule YAML) with severity labels and
annotations.runbook_urllinks when the user provides a Confluence page.
The skill also embeds canonical reference panels (stat, timeseries, table) so every generated panel follows the same field contract, and closes the loop by asking you to import the JSON and feed back Grafana errors for a second iteration.
The skill is a SKILL.md file plus its templates/ directory. Any
agent that loads skills (opencode, Claude Code, Cursor, ...) picks it up
from the relevant skills location.
git clone https://github.com/philyuchkoff/GrafanaSmith.git
ln -s "$(pwd)/GrafanaSmith/skills/grafana-dashboard" \
~/.config/opencode/skills/grafana-dashboardRestart opencode so the new skill is loaded.
git clone https://github.com/philyuchkoff/GrafanaSmith.git
mkdir -p ~/.claude/skills
cp -R GrafanaSmith/skills/grafana-dashboard ~/.claude/skills/(Claude Code loads ~/.claude/skills/<name>/SKILL.md; Cursor reads
.cursor/skills/ in the project or the equivalent user-level directory.)
To use the skill only inside one repository, copy it into the project's
skill directory (e.g. .opencode/skills/ for opencode):
mkdir -p .opencode/skills
cp -R skills/grafana-dashboard .opencode/skills/Invoke the skill by describing the service and pasting the scrape config:
"Generate a Grafana dashboard for our PostgreSQL 14 cluster — 1 primary, 2 replicas, production, ~5000 QPS. Here is the scrape config: ..."
The skill will:
- Parse the scrape config and identify available metrics, label structure, and instance roles.
- Load the matching template from
templates/and match it against the service description. - Ask at most 3-4 clarifying questions (topology, SLI, alerting, time aggregation) if anything is ambiguous.
- Produce a complete dashboard JSON plus a short description of the panel structure, then ask you to import it and report any errors.
To refine an existing dashboard:
"Add a Replication section to the dashboard and tighten the error rate threshold to 80/95."
The skill will keep the existing panels intact and apply only the requested change, showing a diff at the end.
GrafanaSmith/
├── CHANGELOG.md
├── README.md # this file
├── README-ru.md # Russian version
├── LICENSE # MIT
├── .github/workflows/ # CI: validates SKILL.md frontmatter, templates, and JSON
├── tests/
│ ├── fixtures/ # Test inputs for regression checks
│ └── validate_dashboard.py # Dashboard JSON validator
└── skills/
└── grafana-dashboard/
├── SKILL.md # the skill itself
├── compatibility-matrix.md # metric renames across exporter versions
└── templates/ # per-service templates (14 services)
├── postgresql.md
├── postgresql-patroni.md
├── mysql.md
├── redis.md
├── redis-cluster.md
├── kafka.md
├── nginx.md
├── elasticsearch.md
├── mongodb.md
├── rabbitmq.md
├── powerdns.md
├── node-exporter.md
├── kubernetes-pods.md
└── generic.md
When you add a new service template, follow these rules:
- Pick metrics the exporter actually emits. Verify against the exporter documentation; do not invent metric names.
- Use
$__rate_intervalinrate()windows so the dashboard behaves well at any zoom level. Fixed windows ([5m]) are only valid in Prometheus alert rules, where$__rate_intervaldoes not exist. - Always include
legendFormatwith at least one label interpolated. - Thresholds must map to an SLO or an incident-driven signal. Random thresholds are noise.
- Group panels into rows with
collapsed: falseso the dashboard stays navigable. - Variables are case-sensitive and snake_case.
$replica_typeover$ReplicaType. - Set
uniton every panel and follow theuidconvention<environment>-<service>-<purpose>.
Contributions are welcome. The most useful additions are:
- New service templates (Cassandra, ClickHouse, Envoy, HAProxy, ...) — create
templates/<service>.md. - Better defaults for thresholds based on real-world SLOs.
- Additional PromQL patterns for hard-to-expose signals.
- Translations of the documentation.
Open a pull request with the new template under
skills/grafana-dashboard/templates/<service>.md.
- Auto-export of Prometheus alert rule files → done in 0.2.0
- CI/CD for skill validation → done in 0.2.0
- More templates (Elasticsearch, MongoDB, RabbitMQ, Patroni, Redis Cluster) → done in 0.2.0
- Templated drill-down dashboards (cluster -> node -> query).
- A hosted catalog of community-contributed service templates.
- Graph-based auto-detection of service type from RN Prometheus metric names alone (no service_description needed).
- Provisioning manifests (Grafana provisioning, Terraform).
- Linter that validates a Grafana JSON against the conventions.
MIT. See LICENSE.