PCA PCA Storage & Retention 2 — Questions and Answers
Question 1: Which Prometheus feature enables long-term metric storage by sending data to an external system?
- remote_write (Correct answer)
- federation
- file_sd_configs
- recording_rules
Correct answer: remote_write
remote_write streams scraped metrics to an external storage backend like Thanos, Cortex, or VictoriaMetrics for long-term retention.
Question 2: What does Prometheus TSDB compaction do?
- Merges and deduplicated smaller blocks into larger, more efficient blocks (Correct answer)
- Converts text exposition format to binary
- Compresses WAL files to reduce RAM usage
- Aggregates metrics across multiple Prometheus instances
Correct answer: Merges and deduplicated smaller blocks into larger, more efficient blocks
Compaction merges multiple small blocks into larger ones and removes deleted or out-of-order samples to improve query efficiency.
Question 3: What is a Prometheus 'block' on disk?
- An immutable directory containing chunks, an index, and metadata for a fixed time range (Correct answer)
- A single scrape result file per target
- A WAL segment written every 15 seconds
- A JSON export of all active time series
Correct answer: An immutable directory containing chunks, an index, and metadata for a fixed time range
A TSDB block is an immutable directory holding compressed chunk files, an inverted index, and a meta.json describing its time range.
Question 4: Which flag controls how long Prometheus retains data when using time-based retention?
- --storage.tsdb.retention.time (Correct answer)
- --storage.tsdb.max-age
- --tsdb.retention-days
- --storage.local.retention
Correct answer: --storage.tsdb.retention.time
The --storage.tsdb.retention.time flag specifies the maximum age of data blocks before they are deleted.
Question 5: What is Prometheus federation primarily used for in storage contexts?
- Allowing one Prometheus server to scrape metrics from another Prometheus server (Correct answer)
- Replicating data across multiple TSDB nodes
- Synchronizing WAL files between HA pairs
- Backing up blocks to object storage
Correct answer: Allowing one Prometheus server to scrape metrics from another Prometheus server
Federation lets a higher-level Prometheus scrape aggregated or selected metrics from one or more other Prometheus instances.
Question 6: What does the `remote_read` configuration in Prometheus enable?
- Querying historical data from a remote storage backend when local data is unavailable (Correct answer)
- Reading scrape targets from a remote file server
- Fetching recording rules from a remote API
- Importing Grafana dashboards remotely
Correct answer: Querying historical data from a remote storage backend when local data is unavailable
remote_read allows Prometheus to transparently query an external long-term storage system for data that is no longer in local storage.
Which Prometheus feature enables long-term metric storage by sending data to an external system?