PCA PCA Storage & Retention 1 — Questions and Answers
Question 1: What is the default local storage retention period for Prometheus time-series data?
- 15 days (Correct answer)
- 30 days
- 7 days
- 90 days
Correct answer: 15 days
By default, Prometheus retains local data for 15 days before it is deleted.
Question 2: Which Prometheus storage format organizes data into time-based directories called blocks?
- TSDB (Time Series Database) (Correct answer)
- LevelDB
- RocksDB
- InfluxDB line protocol
Correct answer: TSDB (Time Series Database)
Prometheus uses its own TSDB which stores data in immutable time-based blocks on disk.
Question 3: Which flag sets the maximum amount of disk space Prometheus can use for local storage?
- --storage.tsdb.retention.size (Correct answer)
- --storage.tsdb.max-disk
- --storage.local.max-size
- --tsdb.disk-limit
Correct answer: --storage.tsdb.retention.size
The --storage.tsdb.retention.size flag caps how much disk Prometheus uses, deleting old blocks when the limit is reached.
Question 4: What is the Write-Ahead Log (WAL) in Prometheus TSDB used for?
- Durably recording incoming samples before they are compacted into blocks (Correct answer)
- Pre-computing recording rules before they run
- Streaming metrics to remote storage in real time
- Logging HTTP scrape requests for debugging
Correct answer: Durably recording incoming samples before they are compacted into blocks
The WAL ensures that data received by Prometheus is not lost if the process crashes before samples are flushed to a block.
Question 5: How long does Prometheus keep data in memory before writing it to a disk block by default?
- 2 hours (Correct answer)
- 15 minutes
- 24 hours
- 1 hour
Correct answer: 2 hours
Prometheus accumulates data in a head block in memory for approximately 2 hours before compacting it to disk.
Question 6: What does Prometheus do when its local disk retention limit is reached?
- Deletes the oldest TSDB blocks first (Correct answer)
- Stops accepting new scrapes
- Writes excess data to remote_write only
- Compresses all blocks to save space
Correct answer: Deletes the oldest TSDB blocks first
When the retention limit is hit, Prometheus removes the oldest data blocks to free disk space.
What is the default local storage retention period for Prometheus time-series data?