Prometheus TSDB Snapshot Backup & Restore Prompt
Design a reliable backup and restore procedure for the Prometheus TSDB using the admin snapshot API, object-storage offload, and a tested recovery runbook so you can rebuild a server without silent data loss.
- Target user
- SREs running self-hosted Prometheus they cannot afford to lose
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior observability engineer who has rebuilt corrupted Prometheus servers from cold backups under incident pressure and knows exactly which files matter. I will provide: - My Prometheus version, deployment (binary/Docker/Operator), and storage path/size - My retention setting, scrape volume, and whether remote-write to long-term storage is enabled - My current backup approach (cron rsync, none, volume snapshot, etc.) and target store (S3/GCS/NFS) Your job: 1. **Choose the snapshot mechanism** — explain the `/api/v1/admin/tsdb/snapshot` endpoint, why `--web.enable-admin-api` is required, and how snapshots hard-link blocks into `snapshots/` so they are cheap and consistent. 2. **Handle the WAL and head block** — clarify that a snapshot includes the in-memory head flushed to a block, and what data within the current scrape window may still be at risk. 3. **Design the offload** — produce a backup script that triggers the snapshot, copies the snapshot directory to object storage, and prunes old snapshots both locally and remotely. 4. **Write the restore runbook** — exact steps to stop Prometheus, lay blocks into the data dir, fix ownership/permissions, and start clean, including verification queries. 5. **Decide if you even need it** — compare TSDB backup vs relying on remote-write + a fresh server, and when each is the right RPO/RTO answer. 6. **Validate the backup** — a periodic restore drill against a throwaway instance so the backup is proven, not assumed. Output as: (a) annotated backup script, (b) numbered restore runbook, (c) an RPO/RTO table for my setup, (d) the single most likely restore failure for my deployment. Never present an untested backup as a recovery guarantee — a backup is only real once you have restored from it.
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 Native OTLP Receiver Ingestion Prompt
Enable and tune Prometheus's built-in OTLP metrics receiver (/api/v1/otlp/v1/metrics) so OpenTelemetry SDKs and Collectors can push straight into Prometheus with correct name translation, resource-attribute promotion, and out-of-order handling — without a separate remote_write bridge.
-
Prometheus TSDB Head Memory & Series Churn Prompt
Diagnose Prometheus memory pressure driven by the in-memory head block, distinguishing high active-series load from high series churn, and applying the right remediation for each.
-
Prometheus WAL Replay Startup Latency Prompt
Diagnose and reduce slow Prometheus startup caused by long write-ahead-log (WAL) replay, so a restarting server returns to a healthy, scrapeable state quickly after deploys or crashes.
-
Prometheus Out-of-Order Sample Ingestion Tuning Prompt
Configure and tune out-of-order sample ingestion (tsdb.out_of_order_time_window) to accept delayed/backfilled samples without breaking compaction or exploding memory.
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.