Courseiva

PCA · domain

Promql

The PromQL domain covers Prometheus's query language: selecting series with label matchers, applying range vectors and functions, and combining results with operators. Questions are scenario-based, asking you to pick valid metric types, matchers, or functions, and to reason about operator precedence and aggregation behavior when building queries.

66 questions18 easy29 medium19 hard

Focused practice

Practice Promql questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Promql

Be able to write and read PromQL: choose correct metric types, build label matchers, apply rate() and histogram_quantile() to histograms, and combine series with operators respecting precedence. The single most important skill is selecting the right function for the metric type and query intent.

Selecting time series using instant and range vector selectors with label matchers

Applying PromQL functions such as rate(), histogram_quantile(), and aggregation operators

Understanding native Prometheus metric types: counter, gauge, histogram, and summary

Evaluating operator precedence and arithmetic, comparison, and logical set operations

Watch out for

Common Promql exam traps

  • ▸Confusing histogram_quantile() with quantile() or assuming summaries expose _bucket series for percentile queries
  • ▸Using =~ regex matchers without anchoring, or treating != and !~ as equivalent to absence of a label
  • ▸Forgetting that rate() needs a range vector and that counters reset, so raw counter values mislead

Question index

All Promql questions (66)

Click any question to see the full explanation, or start a practice session above.

1

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

Hard
2

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

Medium
3

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

Hard
4

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?

Medium
5

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?

Medium
6

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?

Hard
7

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

Easy
8

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

Easy
9

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)?

Hard
10

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

Medium
11

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

Medium
12

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

Medium
13

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

Hard
14

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?

Hard
15

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

Hard
16

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?

Easy
17

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

Easy
18

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

Easy
19

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

Hard
20

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?

Medium
21

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

Medium
22

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?

Medium
23

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

Hard
24

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

Easy
25

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

Medium
26

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

Medium
27

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

Easy
28

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

Medium
29

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?

Hard
30

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

Medium
31

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

Easy
32

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

Hard
33

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

Hard
34

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

Medium
35

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

Hard
36

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

Medium
37

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?

Medium
38

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

Medium
39

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

Medium
40

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

Easy
41

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

Easy
42

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?

Medium
43

Which TWO of the following are true regarding instant vectors?

Medium
44

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

Medium
45

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

Easy
46

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

Medium
47

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

Easy
48

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

Easy
49

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

Medium
50

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

Easy
51

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

Medium
52

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

Hard
53

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

Hard
54

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

Hard
55

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

Easy
56

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

Medium
57

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

Easy
58

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

Medium
59

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

Easy
60

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

Hard
61

Which operator has the highest precedence in PromQL?

Medium
62

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

Easy
63

When performing a vector-to-vector binary operation between two instant vectors of different label sets, which modifier allows matching on a subset of common labels?

Medium
64

Which THREE of the following are valid label matchers?

Hard
65

When executing a subquery in PromQL, such as 'max_over_time(rate(http_request_total[5m])[30m:1m])', what does the resolution parameter ('1m') specify?

Hard
66

What is the primary operational difference between the 'rate()' and 'irate()' functions in PromQL?

Medium

Frequently asked questions

What does the Promql domain cover on the PCA exam?
Be able to write and read PromQL: choose correct metric types, build label matchers, apply rate() and histogram_quantile() to histograms, and combine series with operators respecting precedence. The single most important skill is selecting the right function for the metric type and query intent.
How many questions are in this domain?
This page lists all 66 Promql questions in the PCA question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Promql questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
Prometheus Certified Associate (PCA, CNCF/Linux Foundation) (PCA) Promql Practice Questions