Most Grafana dashboards are built once, exported to JSON, copied around, and then quietly stop being opened — because they show a wall of CPU graphs and no one in an incident wants a CPU graph. A dashboard that gets used during a real incident answers three questions in the first screen: is the service degraded, where is the degradation, and what should I read to do something about it. This article walks through the layout and the panel choices that make a dashboard useful at 3 a.m., and the provisioning pattern that keeps it in version control.
How to verify
A dashboard is “ready” when an on-call who has never opened it can find the impact in under 30 seconds. Concrete checks:
# JSON exists in the repo and matches what's in Grafana
diff <(curl -fsS "https://grafana.example.com/api/dashboards/uid/svc-web" \
-H "Authorization: Bearer $GRAFANA_TOKEN" | jq -S '.dashboard') \
dashboards/svc-web.json
# Provisioning is picking it up
sudo grep -r 'svc-web' /etc/grafana/provisioning/
# Variables work — query the Prometheus the dashboard targets and see the same series
curl -fsS http://prom:9090/api/v1/label/service/values | jq
# The runbook links resolve
for u in $(jq -r '.panels[].links[]?.url' dashboards/svc-web.json); do
curl -fsSI "$u" | head -1
done
If the diff between the live JSON and the file in the repo is non-empty, someone has been editing in the UI and your dashboards are not actually under version control.
What’s happening
The RED method (Rate, Errors, Duration) is the smallest set of signals that describes a request-driven service. For each service you operate, three time series — request rate, error rate, p95 duration — answer “is it serving traffic, is the traffic succeeding, is it fast enough.” Everything else (CPU, memory, GC pauses, replica lag) is supporting evidence for why the RED signals look the way they do; it does not belong on the same row.
Variables turn one dashboard into many. A service variable bound to label_values(http_requests_total, service) and an env variable bound to label_values(http_requests_total{service="$service"}, env) let the same dashboard render for web in prod or api in staging. Dashboards without variables get cloned per service and rot independently.
The third design choice is where to send the on-call from a panel. A panel has a Links section that can point to a runbook, a related dashboard (the database backing this service, the upstream service), or a saved Loki query for the time range. A panel without links sends the on-call back to a search bar.
The procedure
-
Start with the top row — the RED triad — at full width.
-
Rate (requests/sec by status class):
sum by (status_class) ( rate(http_requests_total{service="$service", env="$env"}[5m]) ) -
Errors (5xx ratio):
sum(rate(http_requests_total{service="$service", env="$env", status=~"5.."}[5m])) / sum(rate(http_requests_total{service="$service", env="$env"}[5m]))Set the panel to “percent (0.0-1.0)” and thresholds at 1% (yellow) and 5% (red).
-
Duration p50/p95/p99 as three lines on one graph:
histogram_quantile(0.50, sum by (le) (rate(http_request_duration_seconds_bucket{service="$service", env="$env"}[5m]))) histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket{service="$service", env="$env"}[5m]))) histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket{service="$service", env="$env"}[5m])))
-
-
Second row: per-route breakdown. The same metrics, split by
route, as tables sorted by p95 descending. This is where the on-call sees that the global p95 spike is concentrated on/checkoutand not on every route. -
Third row: dependencies. A row each for the database, the cache, and any upstream HTTP service. Two panels per dependency: latency from the service’s perspective (client-side histogram if available, otherwise upstream-reported duration) and error rate from the same vantage point. Avoid dependency-internal metrics (PostgreSQL
pg_stat_activity) — those go on the database’s own dashboard, linked from here. -
Fourth row: capacity. CPU per instance, memory per instance, network I/O. These exist to answer “is the host the bottleneck”; they should not be the first thing seen.
-
Add panel-level links to runbooks. In each panel’s settings, add a link with the title “Runbook” pointing to the matching wiki page. Most-used panels (error rate, p95) point to dedicated runbooks; the rest can point to the service’s main runbook.
-
Provision the dashboard from JSON. Export the dashboard, strip the
idandversionfields, commit to a repo, and provision it.# /etc/grafana/provisioning/dashboards/svc-web.yaml apiVersion: 1 providers: - name: 'svc-web' folder: 'Services' type: file options: path: /var/lib/grafana/dashboards/svc-web foldersFromFilesStructure: trueA CI job copies
dashboards/svc-web/*.jsoninto/var/lib/grafana/dashboards/svc-web/on merge to main; Grafana re-loads from disk on its next provisioning poll. SetallowUiUpdates: falseon the provider so the UI cannot drift from the repo. -
Lock the dashboard against UI edits. With
allowUiUpdates: false, the Save button warns and refuses to overwrite. Operators who want a permanent change open a pull request against the JSON file instead.
Common pitfalls
- A first row of CPU and memory graphs; the on-call has to scroll to see whether the service is even up.
- Variables that resolve from a label populated by a single noisy job, so the dropdown shows hundreds of values and the dashboard is slow to render.
- Hardcoded
clusterorenvin queries because variables felt like over-engineering; the dashboard gets cloned per environment and copies drift. - Panels with hardcoded thresholds that no longer match the SLO; the dashboard says “green” while the SLO budget is being burned.
- Runbook links that point at PDFs in a shared drive that the on-call cannot reach from the laptop they actually use on call.
For the alerts that should be the entry point to this dashboard, see prometheus-alerting-rules. For the metrics those alerts read, see prometheus-node-exporter.
Stack Harbor builds and maintains dashboards as part of the managed operations tier — RED at the top, provisioned from JSON in version control, with runbook links the on-call can open without leaving the page.