PCA (Prometheus Certified Associate) sample exam question with answer 33
Question:
Which PromQL query returns the maximum value of the http_requests_total metric for each instance in a cluster?
- max_over_time(http_requests_total[1m])
- max(http_requests_total) by (instance)
- sum(http_requests_total) by (instance)
Answer:
B - The max() function is used to return the maximum value of a metric.
The by clause is used to group the metric values by a specific label,
in this case, the instance label which refers to the individual instances in a cluster