Which PromQL expression computes how many requests in total are currently in-flight for the following time series data?apiserver_current_inflight_requests{instance="1"} 5apiserver_current_inflight_requests{instance="2"} 7
Answer(s): B
In Prometheus, when you have multiple time series that represent the same type of measurement across different instances, the sum() aggregation operator is used to compute their total value.Here, each instance (1 and 2) exposes the metric apiserver_current_inflight_requests, indicating the number of active API requests currently being processed.To find the total number of in-flight requests across all instances, the correct expression is:sum(apiserver_current_inflight_requests)This returns 5 + 7 = 12.min() would return the lowest value (5).max() would return the highest value (7).sum_over_time() calculates the cumulative sum over a range vector, not the current value, so it's incorrect here.
Verified from Prometheus documentation Aggregation Operators and Summing Across Dimensions sections.
Given the metric prometheus_tsdb_lowest_timestamp_seconds, how do you know in which month the lowest timestamp of your Prometheus TSDB belongs?
Answer(s): D
The metric prometheus_tsdb_lowest_timestamp_seconds provides the oldest stored sample timestamp in Prometheus's local TSDB (in Unix epoch seconds). To determine the age or approximate date of this timestamp, you compare it with the current time (using time() in PromQL).The expression:(time() - prometheus_tsdb_lowest_timestamp_seconds) / 86400converts the difference between the current time and the oldest timestamp from seconds into days (1 day = 86,400 seconds). This gives the number of days since the earliest sample was stored, allowing you to infer the time range and approximate month manually.The other options are invalid because PromQL does not support direct date formatting (format_date) or month() extraction functions.
Extracted and verified from Prometheus documentation TSDB Internal Metrics, Time Functions in PromQL, and Using time() for Relative Calculations.
Which of the following is an invalid @ modifier expression?
The @ modifier in PromQL allows querying data as it existed at a specific point in time rather than the evaluation time. It can be applied after a selector or an entire expression, but the syntax rules are strict.go_goroutines @ start() Valid; queries value at the start of the evaluation range.sum(http_requests_total{method="GET"}) @ 1609746000 Valid; applies the modifier after the full expression.go_goroutines @ end() Valid; queries value at the end of the evaluation range.sum(http_requests_total{method="GET"} @ 1609746000) Invalid, because the @ modifier cannot appear inside the selector braces; it must appear after the selector or aggregation expression.This invalid placement violates PromQL's syntax grammar for subquery and modifier ordering.
Verified from Prometheus documentation PromQL @ Modifier Syntax, Evaluation Modifiers, and PromQL Expression Grammar sections.
What function calculates the tp-quantile from a histogram?
Answer(s): A
In Prometheus, the histogram_quantile() function is specifically designed to compute quantiles (such as tp90, tp95, or tp99) from histogram bucket data. A histogram metric records cumulative bucket counts for observed values under specific thresholds (le label).The function works by interpolating between buckets based on the target quantile. For example, to compute the 90th percentile latency from a histogram named http_request_duration_seconds_bucket, you would use:histogram_quantile(0.9, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))Here, 0.9 represents the tp90 quantile, and rate() converts counter increments into per-second rates.Other options are incorrect:histogram() is not a valid PromQL function.predict_linear() forecasts future values of a time series.avg_over_time() computes a simple average over a time window, not quantiles.
Verified from Prometheus documentation PromQL Function: histogram_quantile(), Working with Histograms, and Quantile Calculation Details.
Which PromQL statement returns the sum of all values of the metric node_memory_MemAvailable_bytes from 10 minutes ago?
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.
Post your Comments and Discuss Linux Foundation PCA exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the PCA content, but please register or login to continue.