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

Question:
Given a metric http_requests_total with labels method and status_code, which of the following queries gives the current count of 500 status POST requests?

  1. http_requests_total{method=POST, status_code=500}
  2. http_requests_total{method="POST" status_code="500"}
  3. http_requests_total{method="POST", status_code="500"}
  4. http_requests_total[method="POST", status_code="500"]
Answer:
C - correct
A - label selector values must be surrounded in quotes
B - multiple label selectors must be separated by a comma
D - label selectors must be surrounded by curly brackets, not square brackets