Courseiva

CCNA Promql Questions

75 of 81 questions · Page 1/2 · Promql · Answers revealed

1
MCQhard

If you perform 'A / B' where A and B have different sets of labels, what happens?

A.It automatically ignores the extra labels.
B.It returns an empty result.
C.It returns the result of the division for all series.
D.It returns an error in the UI.
AnswerB

Without group or matching modifiers, no series will match.

Why this answer

Binary operations require matching labels unless modifiers are used; otherwise, the result is empty.

2
Multi-Selectmedium

Which THREE of the following functions can be used with counter metrics to calculate rates or increases? (Choose three)

Select 3 answers
A.predict_linear()
B.irate()
C.deriv()
D.rate()
E.increase()
AnswersB, D, E

irate() calculates the instantaneous rate of increase for counters.

Why this answer

Counters can be used with rate(), irate(), and increase() functions (among others like delta() for gauges, though delta is technically for gauges, increase is for counters).

3
Multi-Selecthard

Which TWO of the following statements about PromQL label matchers are correct? (Choose TWO)

Select 2 answers
A.The = operator performs an exact string match.
B.The ?= operator performs fuzzy string matching.
C.The =~ operator is used exclusively for numeric comparisons.
D.The == operator is valid inside label selectors for filtering.
E.The !~ operator performs a negative regular expression match.
AnswersA, E

Correct. = is exact match.

Why this answer

PromQL supports exact equality (=), negative equality (!=), regular expression matching (=~), and negative regular expression matching (!~).

4
MCQmedium

You need to calculate the per-second rate of increase of http_requests_total over a 1-minute window. Why is using a 1-minute range window generally discouraged in production?

A.It is too short relative to typical scrape intervals, leading to high noise and sensitivity to jitter.
B.It disables counter reset detection algorithms.
C.PromQL automatically rejects any range window shorter than 5 minutes.
D.It causes Prometheus to run out of memory due to high sample density.
AnswerA

Correct. Short windows capture too few data points to produce stable rates.

Why this answer

Prometheus scrapes most targets every 15 seconds. A 1-minute window only contains about 4 data points, making the rate calculation highly sensitive to small scraping jitters.

5
MCQmedium

Which function should be used to smooth out short-term fluctuations in a gauge metric by calculating the rolling average over a 10-minute window?

A.rate(node_load1[10m])
B.avg_over_time(node_load1[10m])
C.smooth(node_load1, 10m)
D.avg(node_load1[10m])
AnswerB

Correct. avg_over_time computes the average over a range window for gauges.

Why this answer

The avg_over_time() function calculates the average value of all data points in the specified range vector for each time series.

6
MCQhard

You are joining two vectors where the left vector has labels {job="api", instance="host1"} and the right vector has labels {job="api", region="us-east"}. You use the query 'vector_a + ignoring(instance, region) vector_b'. What does the 'ignoring' modifier do?

A.It replaces missing instance and region labels with default values.
B.It removes 'instance' and 'region' from the final output time series.
C.It causes Prometheus to exclude the listed labels ('instance', 'region') from consideration during the equality check between the two vectors.
D.It hides errors caused by missing 'instance' or 'region' labels in the time series.
AnswerC

'ignoring' drops the specified labels from the matching calculation so that series with different instance or region values can still match on remaining labels.

Why this answer

The 'ignoring' modifier instructs Prometheus to ignore specified labels when conducting vector matching between two vectors.

7
MCQeasy

What is the primary difference between an instant vector and a range vector in PromQL?

A.An instant vector contains a single sample per time series, while a range vector contains a set of samples over time.
B.An instant vector includes timestamps from the future, while range vectors are strictly historical.
C.An instant vector can only be used with counters, while range vectors can only be used with gauges.
D.A range vector evaluates faster because it caches historical calculations.
AnswerA

Correct. Instant vectors represent a single point in time, range vectors represent a historical window.

Why this answer

Instant vectors contain a single sample per time series for the given timestamp, whereas range vectors contain a set of data points over a time window.

8
MCQeasy

What is the difference between 'count' and 'count_values'?

A.count_values is faster.
B.count is for gauges; count_values is for counters.
C.count returns the number of series; count_values returns the frequency of values.
D.There is no difference.
AnswerC

count_values creates new time series based on value frequency.

Why this answer

count aggregates by number of series, while count_values counts the number of occurrences of each sample value.

9
MCQhard

You are troubleshooting a query and notice that label_replace is being used. What is the primary function of label_replace(v, dst_label, replacement, src_label, regex)?

A.It renames the Prometheus server instance in federated environments.
B.It drops all time series that do not contain the specified source label.
C.It matches a regex against a source label value and writes the result into a destination label.
D.It replaces the metric name with a new string.
AnswerC

Correct. label_replace modifies or creates labels based on regular expression extractions.

Why this answer

The label_replace function matches the regex against the value of src_label, and if it matches, sets dst_label to the replacement string.

10
Multi-Selectmedium

Which THREE of the following are valid set operators in PromQL for combining instant vectors? (Choose THREE)

Select 3 answers
A.intersect
B.union
C.unless
D.and
E.or
AnswersC, D, E

Correct. 'unless' is the complement set operator.

Why this answer

PromQL supports three set operators: and (intersection), unless (complement), and or (union).

11
MCQmedium

Which function evaluates the predictable linear extrapolation of a gauge metric over time to predict future values?

A.predict_linear(node_filesystem_free_bytes[1h], 4 * 3600)
B.holt_winters(node_filesystem_free_bytes[1h], 5m, 1m)
C.deriv(node_filesystem_free_bytes[1h])
D.extrapolate_linear(node_filesystem_free_bytes[1h], 4 * 3600)
AnswerA

Correct. predict_linear uses linear regression on a range vector to predict values in the future.

Why this answer

The predict_linear() function predicts the value of a gauge metric 't' seconds into the future based on a range vector using simple linear regression.

12
MCQmedium

When writing a query with arithmetic operators, how does PromQL handle vector matching when both vectors have the exact same label sets?

A.It ignores labels entirely and matches strictly based on metric names.
B.It performs a one-to-one match automatically based on identical label sets.
C.It throws a matching error unless the 'on' modifier is explicitly provided.
D.It performs a cross-product join of all matching series.
AnswerB

Correct. Identical label sets match automatically in one-to-one operations.

Why this answer

By default, PromQL performs a one-to-one match when the label sets of both vectors are identical.

13
Multi-Selecthard

Which TWO of the following statements regarding native histograms in Prometheus are correct? (Choose TWO)

Select 2 answers
A.Native histograms require users to manually pre-define explicit bucket boundaries in application code.
B.The histogram_quantile() function can evaluate native histograms directly.
C.Native histograms store bucket distributions within a single time series sample.
D.Native histograms are incompatible with all rate-related PromQL functions.
E.Native histograms double the memory consumption of traditional counters.
AnswersB, C

Correct. histogram_quantile() supports native histograms seamlessly.

Why this answer

Native histograms store multiple buckets within a single chunk/sample, reducing storage overhead and allowing dynamic bucket resolutions.

14
MCQhard

You need to perform a binary operation between two vectors where the left vector has labels {job="api", instance="a"} and the right vector has labels {job="api"}. You want to match them using the job label while retaining the instance label from the left side. Which modifier configuration is correct?

A.vector_a * on(instance) group_left(job) vector_b
B.vector_a * on(job) group_right(instance) vector_b
C.vector_a * on(job) group_left(instance) vector_b
D.vector_a * ignoring(instance) group_left vector_b
AnswerC

Correct. on(job) matches on job, and group_left(instance) pulls the instance label from the left side.

Why this answer

To match on a subset of labels while retaining extra labels on the left side during a one-to-many or many-to-one operation, group_left must be used with the on modifier.

15
MCQeasy

Which of the following selectors matches metric names that start with 'http_'?

A.http_*(5m)
B.{__name__=~"http_.*"}
C.{metric=~"http_.*"}
D.{__name__="http_*"}
AnswerB

Using the internal '__name__' label with the '=~' regex operator matches metric names starting with 'http_'.

Why this answer

The regex matcher '=~' is used with regular expressions, and '^' anchors the match to the beginning of the string.

16
Multi-Selecthard

When performing vector matching between two vectors of different cardinalities, which THREE vector matching modifiers can be used? (Choose three)

Select 3 answers
A.on
B.group_left
C.group_by
D.match_any
E.ignoring
AnswersA, B, E

'on' restricts which labels are used for matching.

Why this answer

PromQL vector matching modifiers include on, ignoring, group_left, and group_right.

17
MCQeasy

A Prometheus selector includes a negative regex match for environment names: 'environment!="staging"'. Which selector operator achieves this using regular expressions instead of exact matching?

A.environment!~"staging"
B.environment!regex("staging")
C.environment!match("staging")
D.environment!="staging"
AnswerA

The '!~' operator performs a negative regular expression match.

Why this answer

The '!=' operator is for exact inequality, while '!~' is the negative regular expression match operator in PromQL.

18
MCQhard

You are joining an instant vector of application versions with an instant vector of metrics using a many-to-one relationship. The application version vector has more labels than the metric vector. Which keyword must be appended to the matching modifier to include labels from the 'many' side?

A.group_left
B.include_labels
C.keep_all
D.group_right
AnswerA

Correct. group_left allows labels from the 'many' side to be included in the result.

Why this answer

In many-to-one or one-to-many matches, group_left or group_right must be provided to specify which side supplies additional labels.

19
Multi-Selecteasy

Which TWO of the following are valid data types returned by PromQL queries? (Choose two)

Select 2 answers
A.Histogram matrix
B.Range vector
C.Log stream
D.Instant vector
E.Distributed trace
AnswersB, D

A range vector is a fundamental PromQL result type containing a set of data points over a time range for each time series.

Why this answer

PromQL queries evaluate to one of four types: instant vector, range vector, scalar, or string.

20
MCQeasy

A user executes an instant query for a metric without providing a range vector. What type of vector is returned by default?

A.String
B.Range vector
C.Scalar
D.Instant vector
AnswerD

Correct. Queries without a range selector return instant vectors.

Why this answer

An instant vector evaluates to a single data point per time series at the current evaluation timestamp.

21
MCQeasy

Which operator performs a logical 'not' on a comparison?

A.!
B.not
C.unless
D.none
AnswerC

unless provides set difference logic.

Why this answer

The 'unless' set operator is used to filter out series that match the right-hand side.

22
MCQhard

An engineer executes topk(3, http_requests_total). What happens if there are fewer than 3 time series matching the selector?

A.It returns all available time series without padding or error.
B.It pads the remaining slots with synthetic time series valued at 0.
C.It returns NaN for the missing slots.
D.It returns an evaluation error indicating insufficient time series.
AnswerA

Correct. topk returns up to k elements if fewer exist.

Why this answer

If an instant vector has fewer elements than $k$, topk returns all available elements in the vector without error.

23
MCQmedium

You are using the 'predict_linear()' function to forecast disk space exhaustion based on the metric 'node_filesystem_free_bytes'. What type of input data does predict_linear require?

A.An instant vector representing current disk space.
B.A range vector of gauge values and a time duration scalar.
C.Two instant vectors joined via an 'on' clause.
D.A counter range vector wrapped in a rate() function.
AnswerB

predict_linear takes a range vector (e.g., [1h]) and a scalar duration, requiring gauge inputs.

Why this answer

predict_linear predicts the value of a gauge metric 't' seconds into the future based on a range vector using linear regression.

24
Multi-Selectmedium

Which TWO of the following are valid aggregation operators in PromQL?

Select 2 answers
A.sum
B.stddev
C.multiply
D.filter
E.rate
AnswersA, B

sum is a built-in aggregation.

Why this answer

sum and stddev are standard aggregation operators for reducing vector dimensionality.

25
MCQmedium

An operator writes a query to calculate error percentage: sum(rate(errors[5m])) / sum(rate(total[5m])) * 100. What happens if the denominator evaluates to zero or has no matching time series?

A.Prometheus throws a fatal query evaluation runtime exception.
B.The query returns NaN for all series.
C.The query automatically returns infinity.
D.The query returns an empty vector (no data points).
AnswerD

Correct. Division by zero or empty vectors results in an empty result in PromQL.

Why this answer

Division by zero or division by an empty vector in PromQL results in an empty vector output.

26
MCQmedium

You are monitoring a counter metric 'errors_total' and need to calculate the total number of errors that occurred over the last 1 hour. Which function is most appropriate?

A.rate(errors_total[1h])
B.sum(errors_total[1h])
C.delta(errors_total[1h])
D.increase(errors_total[1h])
AnswerD

increase() provides the total increase of the counter over the 1-hour window.

Why this answer

The increase() function returns the total increase in the time series over the specified range vector, properly accounting for counter resets.

27
MCQhard

You need to calculate the ratio of successful HTTP requests (status 200) to total HTTP requests. Both metrics are counters named 'http_requests_total'. How do you construct this query to ensure proper label matching between status='200' and total requests?

A.rate(http_requests_total{status="200"}[5m]) / rate(http_requests_total[5m]) ignoring(status)
B.http_requests_total{status="200"} / ignoring(status) http_requests_total
C.sum(http_requests_total{status="200"}) / sum(http_requests_total)
D.http_requests_total{status="200"} / http_requests_total
AnswerB

Using 'ignoring(status)' allows matching time series that differ only in the 'status' label, successfully computing the ratio.

Why this answer

To divide two vectors with different label sets (e.g., status='200' vs all statuses), you must use binary matching modifiers like 'ignoring(status)' or 'on'.

28
MCQhard

You need to calculate the 99th percentile of request latency across all instances using a Prometheus histogram metric 'http_request_duration_seconds_bucket'. Which function and setup is correct?

A.histogram_quantile(http_request_duration_seconds_bucket[5m], 0.99)
B.quantile_over_time(0.99, http_request_duration_seconds_bucket[5m])
C.histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))
D.rate(histogram_quantile(0.99, http_request_duration_seconds_bucket[5m]))
AnswerC

histogram_quantile takes the target quantile (0.99) and the per-second rate of bucket counts over a range vector.

Why this answer

The histogram_quantile() function calculates the $\phi$-quantile from the buckets of a histogram metric. It requires the bucket metric and the quantile as arguments.

29
MCQhard

What is the behavior of the clamp_max() function when applied to an instant vector?

A.It drops any time series whose value exceeds the specified maximum.
B.It generates an alert if any time series exceeds the maximum.
C.It restricts all values in the vector so that none exceed the specified maximum.
D.It sets values exceeding the maximum to NaN.
AnswerC

Correct. Values above the maximum are set to the maximum value.

Why this answer

clamp_max clamps the values of all time series in the vector to a specified maximum upper limit.

30
MCQeasy

A Prometheus administrator wants to query the current value of the metric 'http_requests_total'. Which of the following PromQL expressions should be used?

A.http_requests_total[5m]
B.http_requests_total
C.rate(http_requests_total)
D.sum(http_requests_total) over (instance)
AnswerB

This is an instant vector selector, returning the most recent sample for each time series.

Why this answer

An instant vector selector like 'http_requests_total' queries the current value (instant vector) of a metric. Range vectors require a duration in brackets.

31
MCQhard

You are joining an instant vector of application metrics with a static configuration instant vector containing target metadata using 'on(instance) group_right'. What does the 'group_right' modifier achieve?

A.It reverses the vector matching direction to evaluate from right to left.
B.It allows the right-hand side to provide more time series than the left-hand side, keeping all right-hand side series and including matched left-hand side data.
C.It drops all labels from the left-hand side vector.
D.It ensures that the output contains only time series found exclusively on the right side.
AnswerB

group_right ensures that all series from the right-hand side are kept in the resulting vector, joined with matching left-hand side series.

Why this answer

In a many-to-one or one-to-many match, group_right causes the metric on the right-hand side to be included for every matching left-hand side, keeping all labels from the right side and supplementing them.

32
MCQmedium

When should you use the 'absent()' function?

A.To alert when a metric has no data points in a given range.
B.To reset a counter.
C.To ignore null values in a calculation.
D.To handle missing labels in a join.
AnswerA

absent() is standard for 'missing metric' alerts.

Why this answer

absent() returns a time series if the input vector is empty, useful for alerting on missing metrics.

33
MCQeasy

Which label matcher operator is used for exact equality in PromQL selectors?

A.IS
B.:=
C.==
D.=
AnswerD

Correct. The = operator matches labels that are exact matches to the provided string.

Why this answer

The = operator is the standard label matcher for exact string equality.

34
MCQmedium

When evaluating a PromQL query involving arithmetic operators, such as 'vector1 + vector2 * vector3', which operator has the highest precedence?

A.Both have equal precedence and are evaluated left-to-right.
B.+ (Addition)
C.* (Multiplication)
D.Precedence is determined by the order of labels.
AnswerC

Multiplication has higher precedence and is evaluated before addition.

Why this answer

Multiplication (*) and division (/) have higher precedence than addition (+) and subtraction (-) in PromQL.

35
Multi-Selecteasy

Which TWO of the following label matching operators are supported in Prometheus label selectors? (Choose two)

Select 2 answers
A.= (exact equality)
B.=~ (regular expression match)
C.#= (wildcard match)
D.== (boolean equality comparison)
E.:= (assignment and match)
AnswersA, B

The '=' operator matches labels equal to the provided string exactly.

Why this answer

Prometheus supports '=' (exact match), '!=' (exact mismatch), '=~' (regex match), and '!~' (regex mismatch).

36
Multi-Selecthard

Which THREE of the following are valid time-range units in PromQL?

Select 3 answers
A.ns
B.m
C.ms
D.h
E.s
AnswersB, D, E

Minutes is a valid unit.

Why this answer

s, m, h, d, w, y are all valid Prometheus duration units.

37
Multi-Selectmedium

Which THREE of the following modifiers or keywords are used in PromQL binary vector matching? (Choose THREE)

Select 3 answers
A.group_left
B.keep_matching
C.on
D.ignoring
E.group_by
AnswersA, C, D

Correct. 'group_left' handles many-to-one joins.

Why this answer

Binary vector matching modifiers include on, ignoring, group_left, and group_right.

38
MCQhard

A Prometheus alert expression uses rate(http_requests_total[5m]) > 10. During a service restart, counter resets occur. How does the rate() function account for these counter resets?

A.It treats the negative difference as an error and returns 0 for the entire range.
B.It adds a fixed offset value configured in Prometheus global settings.
C.It assumes the counter reset to zero and adds the new value to the previous value.
D.It drops the samples surrounding the reset, resulting in a null value for that evaluation.
AnswerC

Correct. rate() detects drops and handles them by assuming a reset to 0.

Why this answer

The rate() function automatically detects decreases in counter values (resets) and adjusts the calculation assuming the counter restarted at zero.

39
Multi-Selectmedium

Which THREE aggregation operators in PromQL support the 'by' and 'without' clause modifiers? (Choose three)

Select 3 answers
A.sum
B.histogram_quantile
C.avg
D.label_replace
E.count
AnswersA, C, E

sum supports grouping via 'by' and 'without'.

Why this answer

Most PromQL aggregators support grouping clauses. Examples include sum, avg, min, max, count, stddev, stdvar, bottomk, topk, quantile.

40
MCQeasy

Which PromQL function is specifically designed to calculate the per-second average rate of increase of a time series over a given range vector?

A.deriv()
B.irate()
C.increase()
D.rate()
AnswerD

rate() calculates the per-second average rate of increase of counter time series.

Why this answer

The rate() function is designed for counters to calculate the per-second average rate of increase, handling counter resets automatically.

41
MCQhard

When using 'irate', what is the impact of choosing a range vector that is too small (e.g., [10s])?

A.It captures high-frequency spikes but can be volatile.
B.It returns an error if no data points are found.
C.The result becomes a scalar.
D.The value is capped at 1.
AnswerA

irate is sensitive to small fluctuations between the two most recent points.

Why this answer

irate only looks at the last two data points in the range; if the range is too small, it might miss changes.

42
MCQhard

When evaluating a rule with offset, such as http_requests_total offset 1h, what exact time does Prometheus query?

A.It fetches data starting 1 hour in the future.
B.It calculates the moving average over the past 1 hour.
C.It delays rule evaluation by 1 hour to wait for late-arriving data.
D.It evaluates the query at the evaluation timestamp minus 1 hour.
AnswerD

Correct. offset shifts the evaluation window into the past.

Why this answer

The offset modifier shifts the evaluation time backward by the specified duration relative to the evaluation timestamp.

43
Multi-Selectmedium

Which TWO of the following are valid ways to modify or add labels to time series in PromQL? (Choose two)

Select 2 answers
A.label_replace()
B.label_join()
C.label_update()
D.label_drop()
E.label_add()
AnswersA, B

label_replace allows matching and replacing regex patterns in label values.

Why this answer

PromQL provides label_replace and label_join to modify and construct labels dynamically.

44
MCQhard

You want to find the maximum value of a gauge metric across all instances over a 1-hour sliding window. Which function accomplishes this?

A.max(node_memory_usage_bytes[1h])
B.max_over_time(node_memory_usage_bytes[1h])
C.topk(1, node_memory_usage_bytes[1h])
D.max_with_range(node_memory_usage_bytes, 1h)
AnswerB

Correct. max_over_time finds the maximum value across the range vector.

Why this answer

The max_over_time() function evaluates the maximum value of all data points in a specified range vector for each time series.

45
MCQmedium

An administrator wants to aggregate CPU usage across all nodes, keeping the instance label while summing the values. Which aggregation clause should be used?

A.sum(node_cpu_seconds_total) keeping (instance)
B.sum by (instance) (node_cpu_seconds_total)
C.sum(node_cpu_seconds_total) group by (instance)
D.sum without (instance) (node_cpu_seconds_total)
AnswerB

Correct. The 'by' clause keeps the specified list of labels and drops all others.

Why this answer

The by clause specifies the labels that should be preserved in the aggregated result vector.

46
MCQmedium

You want to find the top 3 jobs with the highest CPU usage using the metric 'process_cpu_seconds_total'. Which PromQL query structure is correct?

A.topk(3, rate(process_cpu_seconds_total[5m]))
B.bottomk(3, rate(process_cpu_seconds_total[5m]))
C.topk(3, process_cpu_seconds_total[5m])
D.topk(rate(process_cpu_seconds_total[5m]), 3)
AnswerA

topk correctly takes k=3 and an instant vector derived from rate().

Why this answer

The topk() function takes an integer 'k' and an instant vector (typically wrapped in rate()), returning the top k time series with the highest values.

47
MCQmedium

When evaluating a histogram metric, what does the special pseudo-label le represent in bucket time series?

A.The upper bound of the cumulative histogram bucket.
B.The linear extrapolation factor for summary metrics.
C.The logging event identifier for tracing.
D.The exact latency error margin of the measurement.
AnswerA

Correct. 'le' stands for less than or equal to, defining bucket boundaries.

Why this answer

The le (less than or equal to) label represents the upper bound of a histogram bucket.

48
MCQmedium

Which aggregation operator would you use to calculate the total sum of a metric across all instances?

A.sum()
B.avg_over_time()
C.total()
D.count()
AnswerA

sum() aggregates values across all series.

Why this answer

sum() is the standard operator for calculating totals across dimensions.

49
MCQeasy

What is the purpose of the 'offset' modifier in a PromQL query?

A.To remove specific label dimensions.
B.To filter out noise from the last 5 minutes.
C.To change the time range of a query to a point in the past.
D.To increase the precision of a rate calculation.
AnswerC

Offset shifts the time window for the instant or range vector.

Why this answer

The 'offset' modifier allows querying data from the past relative to the current time.

50
MCQeasy

Which PromQL aggregator should be used to count the total number of active time series matching a selector?

A.count(up)
B.sum(up)
C.len(up)
D.total(up)
AnswerA

Correct. count returns the number of series in the vector.

Why this answer

The count operator counts the number of time series in an instant vector.

51
MCQhard

When calculating the 95th percentile from a histogram, why is histogram_quantile(0.95, sum(rate(http_duration_seconds_bucket[5m])) by (le)) the recommended pattern?

A.The 0.95 argument requires the 'le' label to be removed.
B.Aggregating by 'le' keeps the bucket boundaries intact for the quantile calculation.
C.The rate function cannot be used inside histogram_quantile.
D.It is faster than calculating the quantile per instance.
AnswerB

Summing by the 'le' label merges distributions while preserving the necessary bucket structure.

Why this answer

Aggregation must occur before the quantile calculation to ensure all buckets are summed across labels.

52
MCQmedium

When writing a PromQL query involving a vector and a scalar, such as 'node_memory_free_bytes / (1024 * 1024)', how does Prometheus handle label matching?

A.The scalar operation is applied to every time series value in the vector independently, preserving all labels.
B.The operation is only applied to the first time series returned by the vector selector.
C.The scalar is matched against labels of the vector using exact label equality.
D.The query fails because scalars cannot be combined with vectors without an explicit 'on' clause.
AnswerA

A scalar operation applies to every time series in the instant vector without altering or matching labels.

Why this answer

Operations between an instant vector and a scalar are performed on each data point of the vector. Labels are unaffected.

53
Multi-Selectmedium

Which TWO of the following are true regarding instant vectors?

Select 2 answers
A.They contain at most one sample per time series.
B.They do not support label filtering.
C.They contain data over a time range.
D.They can be passed directly to the rate() function.
E.They are the default result of a simple selector.
AnswersA, E

By definition, instant vectors are a single point in time.

Why this answer

Instant vectors contain a single sample per time series, typically the most recent.

54
Multi-Selecthard

Which TWO of the following conditions will cause the rate() function to return NaN or empty results? (Choose TWO)

Select 2 answers
A.The queried metric is a gauge rather than a counter, and samples do not follow monotonic rules.
B.The time series has no samples within the specified range window.
C.The query is executed with an instant vector instead of a range vector.
D.The counter experienced a reset during the window.
E.The range vector contains fewer than two data points.
AnswersB, E

Correct. Zero samples in the range window result in no output.

Why this answer

rate() requires range vectors with sufficient data points and valid counter metrics. Stale series or ranges with zero samples yield empty or NaN results.

55
MCQmedium

You need to calculate the per-second rate of increase for a counter metric over the last 10 minutes. Which function is most appropriate?

A.rate(metric[10m])
B.increase(metric[10m])
C.irate(metric[10m])
D.delta(metric[10m])
AnswerA

rate() divides the total increase by the number of seconds in the range.

Why this answer

rate() is the standard function for calculating the per-second rate of increase over a range vector.

56
Multi-Selecthard

Which THREE of the following are valid ways to modify a binary operation join?

Select 3 answers
A.group_right
B.on
C.merge
D.include
E.ignoring
AnswersA, B, E

group_right is a valid join modifier.

Why this answer

on, ignoring, group_left, and group_right are the valid modifiers for binary joins.

57
MCQeasy

Which selector syntax correctly matches all time series where the environment label does NOT equal production?

A.http_requests_total{environment=~"^((?!production).)*$"}
B.http_requests_total{environment!="production"}
C.http_requests_total{environment!~"production"}
D.http_requests_total{environment!^"production"}
AnswerB

Correct. The != operator matches time series where the label does not match the given string.

Why this answer

The != operator is the standard negative equality matcher in PromQL label selectors.

58
Multi-Selectmedium

Which THREE of the following functions are specifically designed to be used with range vectors? (Choose THREE)

Select 3 answers
A.delta
B.abs
C.rate
D.sum
E.increase
AnswersA, C, E

Correct. delta() takes a range vector.

Why this answer

Functions like rate(), increase(), and delta() require range vectors as arguments, whereas sum() and max() operate on instant vectors.

59
Multi-Selecteasy

Which TWO of the following are valid metric types natively supported by Prometheus? (Choose TWO)

Select 2 answers
A.Matrix
B.Gauge
C.Counter
D.Vector
E.Scalar
AnswersB, C

Correct. Gauge represents a single numerical value that can go up and down.

Why this answer

Prometheus natively supports four core metric types: Counter, Gauge, Histogram, and Summary.

60
MCQeasy

How does PromQL handle operator precedence between arithmetic operators like multiplication (*) and addition (+)?

A.Operators are evaluated strictly from left to right regardless of type.
B.Operators are evaluated strictly from right to left.
C.Multiplication has higher precedence than addition.
D.Addition has higher precedence than multiplication.
AnswerC

Correct. Multiplication evaluates before addition.

Why this answer

PromQL follows standard mathematical order of operations, where multiplication and division take precedence over addition and subtraction.

61
Multi-Selectmedium

Which THREE of the following are valid aggregation operators in PromQL? (Choose THREE)

Select 3 answers
A.median
B.average
C.stddev
D.sum
E.topk
AnswersC, D, E

Correct. stddev is a valid aggregator.

Why this answer

PromQL provides numerous aggregation operators including sum, min, max, avg, stddev, stdvar, count, count_values, bottomk, topk, and quantile.

62
MCQeasy

Which regular expression matcher selects all time series where the status label begins with the digit 5?

A.http_requests_total{status=@"5*"}
B.http_requests_total{status=~"^5.*"}
C.http_requests_total{status=^"5"}
D.http_requests_total{status=~"5$"}
AnswerB

Correct. The regex ^5.* matches any string starting with 5.

Why this answer

The =~ operator combined with a regular expression starting with ^5 matches labels beginning with 5.

63
Multi-Selectmedium

Which TWO of the following statements about 'rate' vs 'irate' are correct?

Select 2 answers
A.irate() returns the average over the whole window.
B.rate() is better for alerting on slow-moving counters.
C.irate() is better for long-term trends.
D.irate() calculates the rate based on the last two points.
E.rate() only works on gauges.
AnswersB, D

rate() provides a smoother average over time.

Why this answer

rate is better for smooth graphs, irate is for high-precision local spikes.

64
MCQhard

How does Prometheus handle subqueries embedded within an instant query, such as rate(http_requests_total[5m])[30m:1m]?

A.It caches the inner query results in memory for 30 minutes.
B.It increases the global scrape interval to 1 minute for the next 30 minutes.
C.It runs the inner instant query at multiple evaluation timestamps over the specified range at the given resolution, returning a range vector.
D.It converts the range vector into a scalar through statistical interpolation.
AnswerC

Correct. Subqueries allow range vector functions to be applied over historical evaluated points.

Why this answer

A subquery evaluates an instant query expression over a given range with a specified resolution at multiple points in time, returning a range vector.

65
Multi-Selecthard

Which THREE built-in functions in PromQL are designed specifically to analyze changes over time for gauge metrics? (Choose three)

Select 3 answers
A.delta()
B.rate()
C.deriv()
D.increase()
E.predict_linear()
AnswersA, C, E

delta() calculates the difference between the first and last value of a gauge in a range vector.

Why this answer

Functions like delta(), deriv(), and predict_linear() (as well as idelta) operate on gauges over range vectors.

66
Multi-Selecthard

Which TWO of the following statements regarding PromQL subqueries are correct? (Choose two)

Select 2 answers
A.Subqueries execute faster than standard instant queries because they bypass the storage engine.
B.Subqueries allow instant vector queries to be passed as range vector inputs to functions like max_over_time().
C.Subqueries have syntax in the form 'expression[range:resolution]'.
D.Subqueries can only be executed against range vectors, never instant vectors.
E.The resolution parameter in a subquery is mandatory.
AnswersB, C

Subqueries bridge the gap by allowing instant query results to be fed into range functions like max_over_time().

Why this answer

Subqueries allow running an instant vector query over a historical time range with a specified resolution and lookback delta.

67
MCQeasy

Which function would you use to find the maximum value of a gauge metric 'node_cpu_load' over the past 30 minutes?

A.rate(node_cpu_load[30m])
B.max(node_cpu_load[30m])
C.topk(1, node_cpu_load[30m])
D.max_over_time(node_cpu_load[30m])
AnswerD

max_over_time() correctly computes the maximum value over the specified range vector for each time series.

Why this answer

The max_over_time() function calculates the maximum value of all data points in the specified range vector for each time series.

68
MCQmedium

You need to calculate the 99th percentile HTTP request latency from a Prometheus histogram named http_request_duration_seconds. Which function is correct?

A.rate(histogram_quantile(0.99, http_request_duration_seconds_bucket)[5m])
B.quantile_over_time(0.99, http_request_duration_seconds[5m])
C.histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))
D.histogram_quantile(http_request_duration_seconds_bucket[5m], 0.99)
AnswerC

Correct. It takes the quantile, a rate of the bucket metric, and computes the value.

Why this answer

The histogram_quantile() function calculates the $\phi$-quantile from bucket time series of a histogram.

69
MCQeasy

What is the purpose of the instant vector selector syntax http_requests_total{job="api-server"}?

A.It aggregates all API server requests into a single sum.
B.It triggers an alert if the job is down.
C.It selects historical data points spanning the last hour for the matching series.
D.It selects current values of time series matching the metric name and label filter.
AnswerD

Correct. It filters instant samples based on metric name and label matchers.

Why this answer

It selects the current value of all time series for the metric http_requests_total that have the label job set to api-server.

70
MCQmedium

Which function is best suited for identifying the 'top 5' instances with the highest value for a specific metric?

A.sort_desc()
B.max_over_time()
C.topk(5, metric)
D.limit_rate(5, metric)
AnswerC

topk returns the top N elements.

Why this answer

topk() is the designated function for returning the N largest samples from an input vector.

71
MCQeasy

Which operator has higher precedence in PromQL: exponential (^), multiplication (*), or addition (+)?

A.Addition (+)
B.All arithmetic operators share equal precedence.
C.Multiplication (*)
D.Exponentiation (^)
AnswerD

Correct. Exponentiation has the highest operator precedence.

Why this answer

Exponentiation has the highest precedence in PromQL, followed by multiplication/division, and then addition/subtraction.

72
MCQhard

An operator needs to find the rate of change of a counter using deriv(). Why is this considered a bad practice in Prometheus?

A.deriv() does not account for counter resets, causing massive negative drops when counters reset.
B.deriv() automatically multiplies output by an undocumented scaling factor.
C.deriv() requires native histograms, which are incompatible with standard counters.
D.deriv() only works with scalar values and rejects time series vectors.
AnswerA

Correct. deriv() treats counters as gauges and fails on resets.

Why this answer

deriv() is designed for linear regression on gauge metrics over range vectors and does not handle counter resets, leading to incorrect downward spikes when counters reset.

73
MCQmedium

Which operator has the highest precedence in PromQL?

A.Logical OR (or)
B.Addition (+)
C.Equality (==)
D.Exponentiation (^)
AnswerD

Exponentiation is the highest precedence operator in PromQL.

Why this answer

PromQL operator precedence follows standard mathematical rules: ^ > *, /, %, +, -.

74
MCQeasy

An operator needs to query the current, un-extrapolated rate of increase per second over the last 5 minutes for a counter metric named http_requests_total. Which function should they use?

A.increase(http_requests_total[5m])
B.irate(http_requests_total[5m])
C.rate(http_requests_total[5m])
D.delta(http_requests_total[5m])
AnswerB

Correct because irate calculates the per-second instant rate based on the last two points.

Why this answer

The irate() function calculates the per-second rate of increase of a time series based on the last two data points in the specified range window, making it ideal for volatile, high-frequency counters.

75
MCQeasy

What is the result of applying a range selector like [5m] to a gauge metric?

A.A scalar value representing the sum.
B.A range vector containing all data points from the last 5 minutes.
C.An instant vector of the average over 5 minutes.
D.An error, because gauges are not time-series.
AnswerB

Range vectors capture the history of samples for each series.

Why this answer

A range selector converts an instant vector into a range vector, containing all samples in that window.

Page 1 of 2 · 81 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Promql questions.