Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation PCA Exam - Topic 2 Question 16 Discussion

Posted by Nettie on Jun 17, 2026 at 06:04 PM

If the vector selector foo[5m] contains 1 1 NaN, what would max_over_time(foo[5m]) return?

Suggested Answer: B

In PromQL, range vector functions like max_over_time() compute an aggregate value (in this case, the maximum) over all samples within a specified time range. The function ignores NaN (Not-a-Number) values when computing the result.

Given the range vector foo[5m] containing samples [1, 1, NaN], the maximum value among the valid numeric samples is 1. Therefore, max_over_time(foo[5m]) returns 1.

Prometheus functions handle missing or invalid data points gracefully---ignoring NaN ensures stable calculations even when intermittent collection issues or resets occur. The function only errors if the selector is syntactically invalid or if no numeric samples exist at all.


Verified from Prometheus documentation -- PromQL Range Vector Functions, Aggregation Over Time Functions, and Handling NaN Values in PromQL sections.

Get Premium PCA Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
CA
Carmen 2 months ago
I’m leaning towards option B, 1 seems like the max.
AR
Argelia 3 months ago
I agree, NaN makes sense with that input.
SI
Sina 3 months ago
I think it should return NaN.
NO
Noelia 3 months ago
I agree with Sharmaine, it should just return the max value.
JA
Janine 3 months ago
Wait, does it really return 1? That seems odd.
AN
An 3 months ago
A max function should ignore NaN, right?
NA
Natalie 3 months ago
Definitely C, NaN is in there.
SH
Sharmaine 4 months ago
I think it returns 1.
EM
Emmanuel 4 months ago
I feel like the answer could be NaN since it's in the vector, but I also recall that max functions might ignore NaN values.
NE
Nenita 4 months ago
I practiced a similar question, and I think NaN can sometimes cause errors, but I'm not confident if that's the case here.
GA
Gail 4 months ago
I think max_over_time should return the maximum value, which in this case would be 1, but I'm a bit confused about how NaN interacts with that.
EL
Elke 4 months ago
I remember something about how NaN values are handled in calculations, but I'm not entirely sure if they would affect the max_over_time function.
0/2000 characters

Save Cancel