How do you backfill historical data into Prometheus?
AdvancedProductionScaling Prometheus, Long-Term Storage & HA
Answer
Use promtool tsdb create-blocks-from with OpenMetrics input, or to backfill new recording rules over past data:
promtool tsdb create-blocks-from rules \
--start 2026-10-01T00:00:00Z --end 2026-11-01T00:00:00Z \
--url http://prometheus:9090 rules.yaml
Move the produced blocks into the data directory (Prometheus picks them up; overlapping blocks are handled since 2.x versions with vertical compaction). This is useful after introducing an SLO recording rule so the 30-day window is full immediately.
More on Scaling Prometheus, Long-Term Storage & HA
What are the practical limits of a single Prometheus server?IntermediateWhen does hierarchical federation still make sense?IntermediateHow do you shard Prometheus scraping, and what do you lose?AdvancedCompare Thanos, Grafana Mimir and VictoriaMetrics.AdvancedThanos sidecar versus Thanos Receive: how do you choose?AdvancedWhat is Prometheus agent mode and when do you use it?Intermediate