Interview Prep/Monitoring & Observability/Scaling Prometheus, Long-Term Storage & HA

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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Scaling Prometheus, Long-Term Storage & HA