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

Question:
Which of the following PromQL expressions can be used to calculate the 99th percentile of a metric?

  1. quantile(0.01, metric_name)
  2. percentile(99, metric_name)
  3. metric_name{quantile="0.99"}
  4. histogram_quantile(0.99, sum(rate(metric_name[5m])) by (le))
Answer:
D - is correct answer. The histogram_quantile function calculates the quantile of a histogram metric. The function takes two arguments: the desired quantile and a subquery that calculates the cumulative distribution function of the histogram. The sum(rate(metric_name[5m])) by (le) subquery calculates the per-second rate of increase of the metric over the past 5 minutes, grouped by the histogram bucket label le