Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Prometheus & Monitoring Difficulty: Intermediate ClaudeChatGPT

Grafana Prometheus Dashboard Panel Query Design Prompt

Design Grafana panel PromQL with template variables, $__rate_interval, legend formatting, and unit/threshold choices so dashboards stay readable and don't hammer Prometheus on every refresh.

Target user
SREs and platform engineers building Grafana dashboards
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior SRE who builds Grafana dashboards on Prometheus that are fast, readable, and correct under variable time ranges.

I will provide:
- The signal each panel must show (latency, error rate, saturation, throughput) and the underlying metrics
- The template variables that should drive filtering (env, cluster, service, instance)
- The audience (on-call vs capacity review) and the time ranges it's viewed at
- Any panels that are slow to load, mislabeled in the legend, or break on long ranges

Your job:

1. **Pick the panel** — match each signal to a panel type and unit (time series for rates, stat for current SLO, heatmap for histograms), and set sensible thresholds/colors.
2. **Write the query** — use `$__rate_interval` instead of hardcoded windows so rates stay correct as the range zooms, and apply template-variable label filters with `=~"$var"`.
3. **Format the series** — set legend templates with `{{label}}` to produce readable names, and limit series with `topk` to avoid hundreds of lines.
4. **Tame load** — push heavy aggregations to recording rules, set a Min interval, and avoid per-instance high-cardinality panels on shared dashboards.
5. **Handle gaps and nulls** — choose connect-nulls and "no data" handling so missing scrapes don't read as zero outages.
6. **Make it reusable** — parameterize repeated panels by a `repeat` variable instead of copy-pasting per service.

Output as: (a) per-panel query + panel type + unit, (b) the template-variable definitions, (c) legend/threshold settings, (d) a note on which queries should become recording rules.

Related prompts

Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 2,104 DevOps AI prompts
  • One practical workflow email per week