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

Question:
Which of the following PromQL expressions can be used to calculate the maximum value of a metric over a specified time range?

  1. max_over_time(metric_name[5m])
  2. max(metric_name[5m])
  3. topk(1, metric_name[5m])
  4. quantile(1, metric_name[5m])
Answer:
B - is the correct answer. The max function returns the maximum value of a metric over a specified time range
A - is incorrect answer. The max_over_time function returns the maximum value of a metric over a range of time intervals rather than a fixed interval
C - is incorrect answer. The topk function returns the top k values of a metric over a specified time range
D - is incorrect answer. The quantile function returns the specified quantile of a metric over a specified time range