PCA (Prometheus Certified Associate) sample exam question with answer 9
Question:
Which PromQL expression selects the average value of the request_latency_seconds metric over the last 5 minutes?
- avg_over_time(request_latency_seconds[5m])
- rate(request_latency_seconds[5m])
- increase(request_latency_seconds[5m])
- um_over_time(request_latency_seconds[5m])
Answer:
A - The avg_over_time() function selects the average value of a metric over a specified time range.
In this case, the range is the last 5 minutes denoted by [5m], and the metric is request_latency_seconds.
Therefore, the correct PromQL expression is avg_over_time(request_latency_seconds[5m]).