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?
- quantile(0.01, metric_name)
- percentile(99, metric_name)
- metric_name{quantile="0.99"}
- 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