PCA (Prometheus Certified Associate) sample exam question with answer 459

Question:
Which of the following PromQL expressions can be used to calculate the 99th percentile response time of a service over the past hour?

  1. histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[1h])) by (le))
  2. quantile_over_time(0.99, http_request_duration_seconds[1h])
  3. percentile_over_time(0.99, http_request_duration_seconds[1h])
  4. histogram_quantile(0.99, sum(http_request_duration_seconds_bucket[1h])) by (le)
Answer:
A - is correct. This expression first calculates the rate of response time buckets (i.e., how many requests fell into each bucket) over the past hour using sum(rate()) and groups them by the bucket label le (which stands for "less than or equal to"). It then uses the histogram_quantile() function to calculate the 99th percentile response time from those bucket rates