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
Pete
9 hours 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
5 days 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
28 days 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
1 month ago
I think the query should use the `sum` function, but I'm not sure about the time range syntax.
upvoted 0 times
...
Tora
1 month 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
1 month 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
2 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
2 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
2 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