Prompt
prometheus long term storage
Latest observation
Prometheus does not have built-in long-term storage in the core server. By default, it stores metrics in a local time-series database on disk, which is great for short-to-medium retention, but not ideal for durable, multi-month or multi-year storage.
Common long-term storage options for Prometheus
1. Remote write to a dedicated backend
Prometheus can send samples to external systems using remote_write. Popular backends include:
- Thanos
- Cortex
- Grafana Mimir
- VictoriaMetrics
- AWS Managed Prometheus / other managed TSDB services
This is the most common approach for scalable long-term retention.
2. Thanos
Adds:
- long-term object storage
- global querying across clusters
- deduplication for HA Prometheus pairs
- downsampling
Typical object storage:
- S3
- GCS
- Azure Blob
3. Cortex / Grafana Mimir
Provides:
- horizontally scalable multi-tenant metrics storage
- remote write ingestion
- long-term retention
- ruler/query components
Good for large-scale environments.
4. VictoriaMetrics
Can be used as:
- a drop-in remote write backend
- single-node or clustered TSDB
- long-term storage with efficient compression
Often simpler to operate than Thanos/Cortex.
5. Simple local retention
If you just want a bit longer retention on a single Prometheus server, you can increase local retention with flags like:
--storage.tsdb.retention.time=30d
Or by size:
--storage.tsdb.retention.size=50GB
This is still not true long-term storage, just longer local retention.
Typical architecture
A common setup is:
- Prometheus scrapes targets
- Prometheus sends samples via
remote_write - Long-term backend stores data in object storage or its own TSDB
- Grafana queries the backend for historical data
Recommendation
If you need:
- simple long-term storage → VictoriaMetrics
- multi-cluster / object-storage-based architecture → Thanos
- large-scale multi-tenant → Mimir/Cortex
If you want, I can also give you:
- a diagram of Prometheus long-term storage architectures, or
- a step-by-step setup using Thanos, Mimir, or VictoriaMetrics.