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

Question:
Which of the following is a correct PromQL query to get the total count of HTTP 500 error responses over the last 24 hours?

  1. sum(http_responses_total{code="500"})
  2. count(http_responses_total{code="500"})
  3. http_responses_total{code="500"} | count
  4. http_responses_total{code="500"} > sum_over_time[1d]
Answer:
A - is the correct answer. To get the total count of HTTP 500 error responses over the last 24 hours, we need to use the sum function to add up all the individual counter values for the HTTP 500 error responses over the last 24 hours