PCA Metric Collection & Data Modeling 3 — Questions and Answers
Question 1: What does the `quantile` label represent in a Prometheus Summary metric?
- The total count of observations
- A pre-calculated percentile value over a sliding time window (Correct answer)
- The number of histogram buckets
- The maximum observed value
Correct answer: A pre-calculated percentile value over a sliding time window
The `quantile` label in a Summary represents a pre-calculated percentile (e.g., 0.95) computed client-side over a configurable sliding window.
Question 2: A Pushgateway metric has a `job` label that conflicts with the scrape target's `job` label. What happens by default?
- The target's label wins and overwrites the pushed label
- The pushed metric's label is preserved and the target's is renamed with `exported_` prefix (Correct answer)
- Prometheus drops the metric
- Both labels are merged into a comma-separated value
Correct answer: The pushed metric's label is preserved and the target's is renamed with `exported_` prefix
When label conflicts occur during scraping, Prometheus prefixes the conflicting scraped label with `exported_` and keeps the pushed metric's label.
Question 3: Which function correctly calculates the per-second rate of increase of a counter over the last 5 minutes, accounting for resets?
- increase(metric[5m])
- rate(metric[5m]) (Correct answer)
- delta(metric[5m])
- irate(metric[5m])
Correct answer: rate(metric[5m])
`rate()` computes the per-second average rate of increase over the specified range, handling counter resets automatically.
Question 4: In the Prometheus data model, what uniquely identifies a time series?
- The metric name alone
- The metric name plus its set of label name-value pairs (Correct answer)
- The metric name plus the job label
- The instance and job labels combined
Correct answer: The metric name plus its set of label name-value pairs
A Prometheus time series is uniquely identified by the combination of its metric name and the complete set of label name-value pairs.
Question 5: What is the primary difference between `rate()` and `irate()` in Prometheus?
- `irate()` handles counter resets while `rate()` does not
- `rate()` averages over the full range while `irate()` uses only the last two data points (Correct answer)
- `irate()` returns values in milliseconds while `rate()` returns per-second
- `rate()` requires a minimum of 5 data points while `irate()` requires 2
Correct answer: `rate()` averages over the full range while `irate()` uses only the last two data points
`irate()` calculates the instantaneous rate using only the last two data points, making it more responsive to spikes but noisier than `rate()`.
Question 6: When configuring a Prometheus scrape job, what does `honor_timestamps: true` do?
- Enables Prometheus to use its own wall-clock time for all scraped samples
- Uses the timestamps provided by the target's exposition format instead of the scrape time (Correct answer)
- Converts all metric timestamps to UTC
- Ignores timestamps older than the scrape interval
Correct answer: Uses the timestamps provided by the target's exposition format instead of the scrape time
`honor_timestamps: true` tells Prometheus to respect the timestamps embedded in the target's metric exposition rather than overriding them with the scrape time.
Question 7: A developer adds a label called `__internal__` to a metric. What will Prometheus do with it?
- Store it as a normal label
- Reject the entire scrape
- Drop the label because labels beginning with `__` are reserved (Correct answer)
- Convert it to a metadata annotation
Correct answer: Drop the label because labels beginning with `__` are reserved
Labels with names beginning with double underscores (`__`) are reserved for Prometheus internal use and are dropped from user-facing metrics.
What does the `quantile` label represent in a Prometheus Summary metric?