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

If the vector selector foo[5m] contains 1 1 NaN, what would max_over_time(foo[5m]) return?
B) 1
A) It errors out.
C) NaN
D) No answer.

Linux Foundation PCA Exam - Topic 2 Question 16 Discussion

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

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

Show Suggested Answer Hide Answer
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.

Contribute your Thoughts:

0/2000 characters

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


Save Cancel