Which function would you use to calculate the 95th percentile latency from histogram data?
Suggested Answer: B
Get Premium PCA Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
To calculate a percentile (e.g., 95th percentile) from histogram data in Prometheus, the correct function is histogram_quantile(). It estimates quantiles based on cumulative bucket counts.
Example:
histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))
This computes the 95th percentile request duration across all observed instances over the last 5 minutes.
30 comments · newest first
ST
Stephanie
7 months ago
B gives the correct percentile from buckets.
RO
Rochell
7 months ago
D doesn't calculate percentiles correctly.
TE
Tequila
7 months ago
C is not applicable here, wrong context.
LE
Leontine
7 months ago
A seems simpler, but not accurate.
CA
Casie
7 months ago
Agreed, B makes sense for histograms.
JO
Joana
8 months ago
Not sure about B, can you really sum rates like that?
CR
Cristal
8 months ago
Wait, is there really a function called histogram_quantile?
CA
Carissa
8 months ago
I thought it was A at first, but B makes more sense.
CA
Carmen
8 months ago
Haha, Dahlia, you're a riot! But I think I'll stick with the more reliable option B. Can't go wrong with the histogram_quantile function.
DA
Dahlia
9 months ago
D) topk(0.95, http_request_duration_seconds) is clearly the best choice. Who needs fancy percentile calculations when you can just get the top 95% of the values?
RA
Raina
9 months ago
I'm going with B as well. The "sum(rate(...))" part is to convert the cumulative histogram into a proper histogram, which is necessary for the quantile calculation.
VA
Vanesa
9 months ago
Option B looks good, but I'm a bit confused about the "sum(rate(...))" part. Shouldn't we just use the raw histogram data?
AL
Alayna
9 months ago
I don’t think it’s C or D since they seem more general and not specifically for histograms.
LI
Linsey
9 months ago
I’m a bit confused between A and B. I know they both deal with quantiles, but I can't recall the specifics of their usage.
LA
Larae
10 months ago
I remember practicing with histogram data, and I feel like `histogram_quantile` was a key function for calculating percentiles.
KA
Karan
10 months ago
I think the answer might be B, but I'm not entirely sure how the `sum(rate(...))` part works in this context.
JE
Jean
10 months ago
I think B is the way to go. The histogram_quantile function looks like it's the best fit for calculating the 95th percentile from the given histogram data.
PE
Pearline
10 months ago
I'm not sure about this one. The question mentions "histogram data," so I'm thinking maybe B or C could work. I'll have to review the details of each function to decide.
HE
Helaine
10 months ago
Okay, I'm pretty confident that B is the correct answer here. The histogram_quantile function is specifically designed for calculating percentiles from histogram data, which is exactly what this question is asking for.
WI
Willow
10 months ago
B is the right choice for histograms!
RI
Ria
11 months ago
I think B is the right choice.
EL
Eleonore
11 months ago
B) histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le)) is the correct answer. It calculates the 95th percentile latency from histogram data.
MI
Mila
11 months ago
Definitely B, it's the standard way to get percentiles from histograms.
CA
Cassandra
11 months ago
Hmm, this one's tricky. I'm leaning towards B, but I'm a bit confused about the difference between the quantile_over_time and histogram_quantile functions. I'll have to double-check the documentation on those.
GE
Georgeanna
12 months ago
I think B is the right answer, but I'm not 100% sure. The histogram_quantile function looks like it might be the way to go for calculating the 95th percentile from the histogram data.
FR
Frank
6 months ago
Definitely B! It’s the best choice for histograms.
KI
Kimbery
6 months ago
I’m leaning towards B as well. It makes sense.
MI
Miesha
6 months ago
Yeah, histogram_quantile is specifically for that.
DA
Dannie
6 months ago
I agree, B seems correct.
CA
Caprice
11 months ago
I thought A might work too, but B is more accurate.