PCA (Prometheus Certified Associate) sample exam question with answer 490
Question:
Which of the following is a correct PromQL query to get the top 5 endpoints with the highest average response time over the last hour?
- topk(5, avg(http_request_duration_seconds)[1h] by (endpoint))
- avg(http_request_duration_seconds) > topk(5)[1h] by (endpoint)
- sum_over_time(http_request_duration_seconds)[1h] > topk(5) by (endpoint)
- max_over_time(avg(http_request_duration_seconds)[1h]) > topk(5) by (endpoint)
Answer:
A - is correct answer. To get the top 5 endpoints with the highest average response time over the last hour, we need to use the topk function to select the top 5 endpoints with the highest average response time over the last hour