U.S. Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation PCA Exam - Topic 2 Question 17 Discussion

How do you calculate the average request duration during the last 5 minutes from a histogram or summary called http_request_duration_seconds?
A) rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_count[5m])
B) rate(http_request_duration_seconds_total[5m]) / rate(http_request_duration_second$_count[5m])
C) rate(http_request_duration_seconds_total[5m]) / rate(http_request_duration_seconds_average[5m])
D) rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_average[5m])

Linux Foundation PCA Exam - Topic 2 Question 17 Discussion

Actual exam question for Linux Foundation's PCA exam
Question #: 17
Topic #: 2
[All PCA Questions]

How do you calculate the average request duration during the last 5 minutes from a histogram or summary called http_request_duration_seconds?

Show Suggested Answer Hide Answer
Suggested Answer: A

In Prometheus, histograms and summaries expose metrics with _sum and _count suffixes to represent total accumulated values and sample counts, respectively. To compute the average request duration over a given time window (for example, 5 minutes), you divide the rate of increase of _sum by the rate of increase of _count:

text{Average duration} = frac{text{rate(http_request_duration_seconds_sum[5m])}}{text{rate(http_request_duration_seconds_count[5m])}}

Here,

http_request_duration_seconds_sum represents the total accumulated request time, and

http_request_duration_seconds_count represents the number of requests observed.

By dividing these rates, you obtain the average request duration per request over the specified time range.


Extracted and verified from Prometheus documentation -- Querying Histograms and Summaries, PromQL Rate Function, and Metric Naming Conventions sections.

Contribute your Thoughts:

0/2000 characters

Currently there are no comments in this discussion, be the first to comment!


Save Cancel