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

Question:
You are creating an exporter that exposes Prometheus metrics from your fitness tracking app.
Which metric type would be BEST for a metric called run_mileage that tracks both the number of runs you have completed and the total mileage?

  1. Gauge
  2. Summary
  3. Histogram
  4. Counter
Answer:
B - is correct answer. A single summary metric can be defined with no quantiles and will expose two metrics: run_mileage_sum that tracks the total mileage and run_mileage_count that tracks the number of runs completed
A - is incorrect as we need to track both the number of runs completed and the total mileage. While this could be accomplished with two gauges, a single gauge is not sufficient
C - is incorrect as it is more than we need for this use case. While a histogram would provide us with the run_mileage_sum and run_mileage_count metrics as desired, it would also require definition of buckets which are unnecessary for the given scenario
D - is incorrect as we need to track both the number of runs completed and the total mileage. While this could be accomplished with two counters, a single counter is not sufficient