PCA Monitoring, Alerting & Troubleshooting 3 — Questions and Answers
Question 1: What is the purpose of the `scrape_timeout` setting in a Prometheus scrape configuration?
- Maximum time to wait for a target to appear in service discovery
- Maximum duration allowed for a single scrape request before it is aborted (Correct answer)
- Maximum time between consecutive scrapes of a target
- Maximum time Prometheus waits before retrying a failed scrape
Correct answer: Maximum duration allowed for a single scrape request before it is aborted
scrape_timeout defines how long Prometheus will wait for a target's HTTP response before canceling the scrape and marking it as a failure.
Question 2: A PromQL query returns `No data` for `rate(http_requests_total[5m])`. The metric exists in Prometheus. What is the most common reason?
- The metric name contains illegal characters
- The selected time window is shorter than two scrape intervals (Correct answer)
- The rate function does not support counter metrics
- Prometheus has no scrape targets configured
Correct answer: The selected time window is shorter than two scrape intervals
rate() requires at least two data points within the range; if the range window is shorter than two scrape intervals, there may be insufficient data.
Question 3: Which Prometheus component is responsible for discovering and maintaining the list of scrape targets?
- Alertmanager
- Pushgateway
- Service discovery / relabeling pipeline (Correct answer)
- Remote write adapter
Correct answer: Service discovery / relabeling pipeline
Prometheus uses service discovery mechanisms (e.g., file_sd, kubernetes_sd) combined with the relabeling pipeline to discover and configure scrape targets.
Question 4: An inhibition rule in Alertmanager has `source_match: {severity: 'critical'}` and `target_match: {severity: 'warning'}`. What happens when a critical alert fires?
- Warning alerts are promoted to critical
- Warning alerts matching the target are suppressed (Correct answer)
- The critical alert is silenced automatically
- Both critical and warning alerts are routed to the same receiver
Correct answer: Warning alerts matching the target are suppressed
Inhibition rules suppress (mute) target alerts when a matching source alert is firing, reducing redundant notifications.
Question 5: What does `increase(errors_total[1h])` calculate in PromQL?
- The average error rate per second over the last hour
- The total increase in the counter value over the last hour (Correct answer)
- The maximum error count observed in the last hour
- The number of times the counter reset in the last hour
Correct answer: The total increase in the counter value over the last hour
increase() calculates the total increase in a counter's value over the specified time range, accounting for resets.
Question 6: In a Prometheus recording rule, what is the primary benefit of pre-computing an expensive query?
- It reduces storage space used by raw metrics
- It speeds up dashboard and alerting queries by storing results as new time series (Correct answer)
- It allows Prometheus to scrape targets more frequently
- It enables cross-cluster federation without network overhead
Correct answer: It speeds up dashboard and alerting queries by storing results as new time series
Recording rules evaluate and store complex expressions as new time series, so dashboards and alerts query the precomputed result instead of recomputing it each time.
Question 7: Which HTTP endpoint should you check on a Prometheus server to verify that a specific target is being scraped successfully?
- /metrics
- /api/v1/targets (Correct answer)
- /api/v1/rules
- /api/v1/alerts
Correct answer: /api/v1/targets
/api/v1/targets returns the current state of all scrape targets including their health status and last scrape error.
What is the purpose of the `scrape_timeout` setting in a Prometheus scrape configuration?