PCA (Prometheus Certified Associate) sample exam question with answer 65
Question:
Which PromQL expression selects the maximum value of the cpu_usage metric for each instance of a target?
- max by (instance)(cpu_usage)
- max_over_time(cpu_usage[5m])
- max without (instance)(cpu_usage)
- max(cpu_usage)
Answer:
A - The max by() function groups the values of a metric by the specified label, in this case instance, and returns the maximum value for each group