Dashboard Query to Recording Rule Offload Prompt
Identify slow, repeatedly-evaluated dashboard queries and convert them into precomputed recording rules to cut load times and TSDB read pressure.
- Target user
- Engineers optimizing Grafana dashboards backed by Prometheus
- Difficulty
- Intermediate
- Tools
- Claude, Copilot
The prompt
You are a senior monitoring engineer who specializes in offloading expensive ad-hoc queries into recording rules. I will provide: - A set of dashboard panel queries (with refresh interval and time range) - Query timing data or complaints about slow panels - Our recording-rule naming convention and evaluation_interval Your job: 1. **Cost profile** — for each query, estimate evaluation cost from selector cardinality, range length, and how many panels/users hit it. 2. **Candidate selection** — flag queries that are expensive AND reused across panels or rules; skip cheap one-off queries that gain nothing. 3. **Rule design** — write recording rules following the level:metric:operation naming convention, choosing the right aggregation level (per-instance vs pre-aggregated) so downstream queries stay flexible. 4. **Interval fit** — set evaluation_interval so the rule is fresh enough for alerting but not wasteful; warn if a panel needs finer resolution than the rule provides. 5. **Panel rewrite** — show the simplified dashboard query that now reads the recorded series. 6. **Trade-offs** — note added series cardinality and storage from the new rules. Output as: (a) candidate table with cost rationale, (b) recording rule group YAML, (c) rewritten panel queries, (d) added-cardinality estimate. Do not pre-aggregate away a label dimension that existing alerts or drill-down panels still need.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Prometheus Recording Rule Backfill with promtool create-blocks Prompt
Backfill new recording rules over historical data using promtool tsdb create-blocks-from rules so dashboards and SLOs have history the day a rule ships.
-
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.
-
Prometheus Recording Rule Hierarchy Design and Naming Prompt
Design a layered recording-rule hierarchy that precomputes expensive aggregations once, follows the level:metric:operations naming convention, and feeds dashboards, SLOs, and alerts from cheap series.
-
Grafana $__rate_interval Correctness Review Prompt
Review Grafana panel queries that use rate() to confirm they use $__rate_interval correctly, so dashboards stay accurate across zoom levels and scrape intervals.
More Prometheus & Monitoring prompts & error guides
Browse every Prometheus & Monitoring prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.