Querying & Visualization Flashcards
7 cards from real PCA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Querying & Visualization flashcards as text
What does the `rate()` function calculate when applied to a counter metric?
Answer: The per-second average rate of increase over the range window
`rate()` calculates the per-second average rate of increase of a counter over the specified time range window.
What is the key difference between `irate()` and `rate()` in PromQL?
Answer: `irate()` uses only the last two data points while `rate()` averages across the full range
`irate()` calculates the instantaneous rate using only the last two samples in the range, making it more responsive to sudden spikes than `rate()`.
What does the `increase()` function return for a counter over a given range vector?
Answer: The total increase in the counter value over the time range
`increase()` returns the total increase in a counter's value over the specified range, accounting for counter resets.
Which label matcher in PromQL uses a regular expression to match label values?
Answer: `=~`
The `=~` matcher selects labels matching a provided regular expression, while `!~` selects labels that do NOT match the regex.
What does `absent(up{job="myapp"})` return when the time series EXISTS?
Answer: An empty vector (no data)
`absent()` returns an empty vector when the input time series exists, and returns a vector with value 1 only when the series is missing.
What result type does the expression `http_requests_total[5m]` produce?
Answer: Range vector
Using a duration in square brackets creates a range vector, which contains a set of time series with a range of data points over the specified time window.
Which PromQL function would you use to predict a gauge's value 1 hour from now based on recent trends?
Answer: `predict_linear()`
`predict_linear(v range-vector, t scalar)` predicts the value t seconds from now using linear regression on the range vector.