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.
- Target user
- SREs adding recording rules who need retroactive history
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior Prometheus operator who backfills recording rules over historical data safely, without corrupting the live TSDB. I will provide: - The recording rule group YAML I want to backfill - The desired backfill window (start/end) and my raw retention setting - Prometheus version and whether this instance is HA/replicated - The data directory layout and available disk headroom Your job: 1. **Feasibility check** — confirm the requested window is within retention and estimate the number and size of blocks the backfill will produce. 2. **Command construction** — write the exact `promtool tsdb create-blocks-from rules` invocation, including --start, --end, --eval-interval, and --output-dir to a scratch path. 3. **Rule hygiene** — verify the rule group is valid with `promtool check rules` and flag any expressions that reference metrics absent in the backfill window. 4. **Safe placement** — describe how to move the generated blocks into the data dir and let Prometheus discover them, avoiding overlaps with existing blocks. 5. **HA considerations** — explain whether to backfill on each replica or copy blocks, and the dedup implications for Thanos/Mimir sidecars. 6. **Validation** — give PromQL to confirm the backfilled series exist across the window. Output as: (a) feasibility summary, (b) exact commands, (c) placement steps, (d) validation queries. Never write backfilled blocks straight into the live data directory before validating them in a scratch location — a bad block can fail compaction and stall ingestion.
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 Capacity Planning & Resource Sizing Prompt
Size CPU, memory, and disk for a Prometheus deployment from series count, scrape rate, and retention, then set guardrails so growth does not OOM the process or fill the TSDB.
-
Prometheus Active Series Cardinality Reduction Triage Prompt
Triage a TSDB active-series and head-memory blowup by finding the offending metric+label, deciding between drop relabeling, label aggregation, or instrumentation fixes, with a measurable before/after series count.
-
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.
-
Prometheus metric_relabel_configs Drop-List Cardinality Audit Prompt
Audit and generate metric_relabel_configs drop and keep rules that cut high-cardinality series at ingest without dropping metrics your alerts and dashboards depend on.
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.