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 4 Question 9 Discussion

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

Which PromQL statement returns the sum of all values of the metric node_memory_MemAvailable_bytes from 10 minutes ago?

Show Suggested Answer Hide Answer
Suggested Answer: A

In PromQL, the offset modifier allows you to query metrics as they were at a past time relative to the current evaluation. To retrieve the value of node_memory_MemAvailable_bytes as it was 10 minutes ago, you place the offset keyword inside the aggregation function's argument, not after it.

The correct query is:

sum(node_memory_MemAvailable_bytes offset 10m)

This computes the total available memory across all instances, based on data from exactly 10 minutes in the past.

Placing offset after the aggregation (as in option B) is syntactically invalid because modifiers apply to instant and range vector selectors, not to complete expressions.


Verified from Prometheus documentation -- PromQL Evaluation Modifiers: offset, Aggregation Operators, and Temporal Query Examples.

Contribute your Thoughts:

0/2000 characters
Joanna
4 days ago
Wait, is it really that simple?
upvoted 0 times
...
Tracey
9 days ago
That's correct!
upvoted 0 times
...
Garry
14 days ago
sum(node_memory_MemAvailable_bytes[10m])
upvoted 0 times
...
Maybelle
20 days ago
I'm just going to guess `sum(node_memory_MemAvailable_bytes{__name__="node_memory_MemAvailable_bytes"} offset 10m)`. Can't be too careful with those Prometheus queries!
upvoted 0 times
...
Lawana
25 days ago
Haha, this question is a real brain-teaser. I bet the answer is something like `sum(node_memory_MemAvailable_bytes) by () offset 10m`.
upvoted 0 times
...
Annett
30 days ago
Wait, isn't it `sum(node_memory_MemAvailable_bytes offset 10m)`? I always get those time-based functions mixed up.
upvoted 0 times
...
Maile
1 month ago
Hmm, I think I need to brush up on my PromQL. Is it `sum_over_time(node_memory_MemAvailable_bytes[10m])`?
upvoted 0 times
...
Terrilyn
1 month ago
The sum of all values from 10 minutes ago? That's easy, just use the `sum_over_time()` function!
upvoted 0 times
...
Pete
2 months ago
I feel like the answer involves `node_memory_MemAvailable_bytes` and a time modifier, but I can't remember the exact syntax for the 10-minute mark.
upvoted 0 times
...
Quentin
2 months ago
I practiced a similar question where we had to use `rate`, but I can't recall if `sum` works the same way with time offsets.
upvoted 0 times
...
Ranee
2 months ago
I remember something about using `offset` to get values from a specific time in the past. Maybe that's what we need here?
upvoted 0 times
...
Afton
3 months ago
I think the query should use the `sum` function, but I'm not sure about the time range syntax.
upvoted 0 times
...
Tora
3 months ago
Hmm, I'm not 100% confident about this. I'll need to double-check the PromQL documentation to make sure I'm using the right syntax and functions. Don't want to mess this up on the exam.
upvoted 0 times
...
Otis
3 months ago
I've got this! The PromQL statement would be: `sum(node_memory_MemAvailable_bytes{}) offset 10m`. The `offset 10m` part should give me the values from 10 minutes ago.
upvoted 0 times
...
Danilo
3 months ago
I'm a bit unsure about the time range part. Do I need to use the `offset()` function to go back 10 minutes? Or is there a more straightforward way to specify the time range?
upvoted 0 times
...
Teddy
3 months ago
Okay, let me break this down step-by-step. I need to get the sum of node_memory_MemAvailable_bytes from 10 minutes ago. I think I can use the `sum()` function for that.
upvoted 0 times
...
Cherrie
3 months ago
Hmm, this looks like a PromQL query question. I'll need to think through the different parts - the metric name, the time range, and the aggregation function.
upvoted 0 times
...

Save Cancel