PCA (Prometheus Certified Associate) sample exam question with answer 521
Question:
You are instrumenting an HTTP API with Prometheus metrics. You want to define a metric that tracks the number of HTTP requests that have been made to your API.
Which of the following metric names and types is the MOST appropriate for this situation?
- http_requests_total, Histogram
- http_requests_total, Counter
- http_requests, Histogram
- http_requests, Counter
Answer:
B - is the correct answer. More at
metric_types and
metric-names
A, C - is incorrect as a histogram is ideal for tracking observations in defined buckets. In this scenario, a counter is sufficient as we only want to count the number of requests received
D - is incorrect as it is a best practice of Prometheus metric naming to include a total suffix for an accumulating count