PCA practice question 1 of 15

What function calculates the tp-quantile from a histogram?

Full set: 60 questions
Answer options
A: histogram_quantile() Correct answer
B: histogram()
C: predict_linear()
D: avg_over_time()
Correct Answer:
A. histogram_quantile()
Explanation

The histogramquantile() function is the specific PromQL function used to calculate the φ-quantile from a histogram. It takes two arguments: the desired quantile (a float between 0 and 1) and an instant vector containing the histogram's bucket counts (the time series with the bucket suffix). It then computes the estimated value at that quantile, allowing users to calculate metrics like the 95th percentile request latency from a histogram metric.

Why Incorrect

histogram() is not a valid PromQL function; it refers to a metric type used for tracking distributions of observations. predictlinear() is a forecasting function that predicts the future value of a time series based on its past behavior, not for quantile calculation. avgovertime() calculates the average value of a time series over a specified time interval, not a quantile from a histogram's distribution.

References

1. Prometheus Authors. (n.d.). Querying functions. Prometheus Documentation. Retrieved from https://prometheus.io/docs/prometheus/latest/querying/functions/#histogramquantile

Reference Details: The section titled "histogramquantile()" explicitly states: "histogramquantile(φ float64, b instant-vector) calculates the φ-quantile (0 ≤ φ ≤ 1) from the buckets b of a histogram." This documentation also confirms the purpose of predictlinear() and avgovertime() in their respective sections.

2. Cloud Native Computing Foundation. (n.d.). Monitoring with Prometheus. Linux Foundation Training.

Reference Details: In the LFS241 - Monitoring Systems and Services with Prometheus course materials, Module 6, "PromQL," covers the usage of aggregation and query functions. The histogramquantile() function is detailed as the primary method for calculating percentiles from histogram metrics, which is a core concept for the PCA certification.

Scroll to Top