Prompt
How do I migrate from Prometheus to long-term metric storage?
Latest observation
Migrating from Prometheus to long-term metric storage usually means keeping Prometheus for scraping/querying short-term data while adding a remote storage backend for durable, scalable retention. In practice, you don’t usually “replace” Prometheus right away—you extend it.
Common long-term storage options
Popular choices include:
- Thanos — Prometheus-compatible, great for long-term object storage, global querying, deduplication, downsampling.
- Cortex / Grafana Mimir — multi-tenant, scalable remote write backend.
- VictoriaMetrics — simpler operationally, very efficient storage and querying.
- Grafana Cloud / managed backends — if you want to avoid running the storage layer yourself.
Typical migration approach
1) Keep Prometheus as the scraper
Continue scraping targets with Prometheus as usual. Prometheus remains the source of ingestion.
2) Choose the storage pattern
You generally have one of these:
- Remote write from Prometheus to a backend (Mimir, Cortex, VictoriaMetrics, etc.)
- Sidecar/object storage model (Thanos Sidecar uploads TSDB blocks to S3/GCS/Azure blob)
- Federation if you need a transitional aggregation layer, though it’s less common for long-term storage
3) Configure durable storage
Set up:
- Object storage bucket: S3, GCS, Azure Blob, MinIO
- Backend components (receive, query, compactor, store gateway, etc.)
- Retention and replication policies
4) Connect Prometheus to the backend
For remote write backends, add to prometheus.yml:
remote_write:
- url: http://<backend>/api/v1/write
If you use Thanos, you often add a sidecar to Prometheus and point Thanos components at object storage.
5) Validate ingestion and querying
Check:
- Samples are arriving in the backend
- Queries return expected results
- Labels match between systems
- Alerting still works
6) Migrate dashboards and alerting
If using Grafana, switch data source queries to the new backend when ready. Keep Prometheus available during transition for comparison.
7) Tune retention
Set Prometheus local retention for short-term performance, e.g.:
storage.tsdb.retention.time: 15d
Then keep long-term data in the backend for months or years.
Important considerations
- Cardinality: long-term systems are sensitive to high label cardinality.
- Query compatibility: most are Prometheus-compatible, but not 100% identical.
- Cost: object storage + query compute can be cheaper than keeping everything in Prometheus.
- Reliability: decide whether the backend is for HA, disaster recovery, or primary querying.
- Downsampling: useful for very old data, especially in Thanos.
A practical migration plan
- Inventory current Prometheus usage, retention, and cardinality.
- Pick backend: Thanos/Mimir/VictoriaMetrics.
- Deploy backend in parallel.
- Start remote write or sidecar upload.
- Compare query results and alert behavior.
- Move Grafana dashboards to backend datasource.
- Shorten Prometheus retention and treat it as “hot” storage only.
- Decommission old storage after validation.
Rule of thumb
- Want simple + efficient? VictoriaMetrics
- Want Prometheus ecosystem + object storage? Thanos
- Want large-scale multi-tenant cloud-native? Mimir/Cortex
If you want, I can give you a step-by-step migration plan for a specific setup—for example:
- Prometheus → Thanos on Kubernetes
- Prometheus → Grafana Mimir
- Prometheus → VictoriaMetrics
- Prometheus → AWS S3-based long-term storage