Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Prometheus & Monitoring Difficulty: Advanced ClaudeChatGPTCursor

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

More Prometheus & Monitoring prompts & error guides

Browse every Prometheus & Monitoring prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.