--storage.tsdb.path flag:
chunks (the actual compressed metrics), an index (for metric names and label lookups), meta.json, and optional WAL/checkpoint files:
chunks: compressed time series samples.index: label and metric name indexes for fast lookups inside the block.meta.json: block metadata (time ranges, version, etc.).tombstones: records of deleted series.walandchunks_head: write-ahead log and in-progress chunk data.
Prometheus stores recent data on local disk by default. Tune retention by time (
--storage.tsdb.retention.time) or by size (--storage.tsdb.retention.size) depending on whether you want to limit based on age or storage consumption.Retention: defaults and flags
By default Prometheus keeps approximately 15 days of samples locally and a retention size of 10 GB. You can change these defaults:- Retention time:
- Retention size:
Warning about retention and disk usage:
If retention flags are not configured according to your ingestion rate, Prometheus may delete data unexpectedly or exhaust disk space. Always plan capacity and monitor disk usage.
Capacity planning
Estimate disk space needed using this formula: disk required = retention time (seconds) × ingested samples per second × bytes per sample- A Prometheus sample typically ranges from ~1–2 bytes for compacted storage, but real-world bytes per sample vary based on label cardinality and compression.
- For accurate planning, measure your average samples/sec and bytes/sample during representative load.

Why local storage doesn’t scale for long-term retention
The simplest way to retain data longer is to attach more block-style disk to the Prometheus server. However:- Block storage can be expensive at scale.
- Prometheus’ TSDB is designed to write to a single local path; it does not horizontally distribute block storage across multiple Prometheus instances.


Remote Read and Remote Write
To avoid the costs and limits of local block storage, Prometheus supports:- remote_write — stream samples to a remote system or long-term storage.
- remote_read — query historical data from a remote store.

write_relabel_configs) to reduce cardinality or route specific metrics to particular remote systems.
Long-term storage systems (Thanos, Grafana Mimir, etc.)
Many open-source and commercial tools exist to provide cost-effective long-term storage for Prometheus data. These systems typically:- Receive replicated data via
remote_writeor ingest Prometheus blocks. - Store compacted data in cheap object stores (S3, Azure Blob).
- Offer queriable APIs that Prometheus or external query layers can use.

For exams or conceptual understanding, you only need to know that tools like Thanos and Grafana Mimir exist to provide long-term, cost-effective storage for Prometheus metrics. Deep internals of those systems are not required for basic certification-level knowledge.
Links and references
- Prometheus TSDB flags and command-line options: https://prometheus.io/docs/prometheus/latest/command-line/flags/
- Amazon S3: https://aws.amazon.com/s3/
- Azure Blob Storage: https://learn.microsoft.com/en-us/azure/storage/blobs/
- InfluxDB: https://www.influxdata.com/
- VictoriaMetrics: https://victoriametrics.com/
- Thanos: https://thanos.io/
- Grafana Mimir: https://grafana.com/oss/mimir/