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

Question:
You are instrumenting an HTTP API with Prometheus metrics. You want to be able to get a count of the in-flight requests.
Which of the following metric names and types is the MOST appropriate for this use case?

  1. http_requests_total, Counter
  2. http_requests_in_flight, Counter
  3. http_requests_total, Gauge
  4. http_requests_in_flight, Gauge
Answer:
D - is the correct answer. Check metric types and metric names
A, B - is incorrect because the number of requests in-flight can increase or decrease arbitrarily. Thus, a counter metric is not appropriate
C - the metric name does not accurately reflect what is being measured