linux foundation pca practice test

Exam Title: Prometheus Certified Associate

Last update: Nov 27 ,2025
Question 1

Which of the following metrics is unsuitable for a Prometheus setup?

  • A. prometheus_engine_query_log_enabled
  • B. promhttp_metric_handler_requests_total{code="500"}
  • C. http_response_total{handler="static/*filepath"}
  • D. user_last_login_timestamp_seconds{email="[email protected]"}
Answer:

D


Explanation:
The metric user_last_login_timestamp_seconds{email="[email protected]"} is unsuitable for
Prometheus because it includes a high-cardinality label (email). Each unique email address would
generate a separate time series, potentially numbering in the millions, which severely impacts
Prometheus performance and memory usage.
Prometheus is optimized for low- to medium-cardinality metrics that represent system-wide
behavior rather than per-user data. High-cardinality metrics cause data explosion, complicating
queries and overwhelming the storage engine.
By contrast, the other metrics—prometheus_engine_query_log_enabled,
promhttp_metric_handler_requests_total{code="500"}, and
http_response_total{handler="static/*filepath"}—adhere to Prometheus best practices. They
represent operational or service-level metrics with limited, manageable label value sets.
Reference:
Extracted and verified from Prometheus documentation – Metric and Label Naming Best Practices,
Cardinality Management, and Anti-Patterns for Metric Design sections.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 2

What Prometheus component would you use if targets are running behind a Firewall/NAT?

  • A. Pull Proxy
  • B. Pull Gateway
  • C. HA Proxy
  • D. PushProx
Answer:

D


Explanation:
When Prometheus targets are behind firewalls or NAT and cannot be reached directly by the
Prometheus server’s pull mechanism, the recommended component to use is PushProx.
PushProx works by reversing the usual pull model. It consists of a PushProx Proxy (accessible by
Prometheus) and PushProx Clients (running alongside the targets). The clients establish outbound
connections to the proxy, which allows Prometheus to “pull” metrics indirectly. This approach
bypasses network restrictions without compromising the Prometheus data model.
Unlike the Pushgateway (which is used for short-lived batch jobs, not network-isolated targets),
PushProx maintains the Prometheus “pull” semantics while accommodating environments where
direct scraping is impossible.
Reference:
Verified from Prometheus documentation and official PushProx design notes – Monitoring Behind
NAT/Firewall, PushProx Overview, and Architecture and Usage Scenarios sections.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 3

You’d like to monitor a short-lived batch job. What Prometheus component would you use?

  • A. PullProxy
  • B. PushGateway
  • C. PushProxy
  • D. PullGateway
Answer:

B


Explanation:
Prometheus normally operates on a pull-based model, where it scrapes metrics from long-running
targets. However, short-lived batch jobs (such as cron jobs or data processing tasks) often finish
before Prometheus can scrape them. To handle this scenario, Prometheus provides the Pushgateway
component.
The Pushgateway allows ephemeral jobs to push their metrics to an intermediary gateway.
Prometheus then scrapes these metrics from the Pushgateway like any other target. This ensures
short-lived jobs have their metrics preserved even after completion.
The Pushgateway should not be used for continuously running applications because it breaks
Prometheus’s usual target lifecycle semantics. Instead, it is intended solely for transient job metrics,
like backups or CI/CD tasks.
Reference:
Verified from Prometheus documentation – Pushing Metrics – The Pushgateway and Use Cases for
Short-Lived Jobs sections.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 4

How do you calculate the average request duration during the last 5 minutes from a histogram or
summary called http_request_duration_seconds?

  • A. rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_count[5m])
  • B. rate(http_request_duration_seconds_total[5m]) / rate(http_request_duration_second$_count[5m])
  • C. rate(http_request_duration_seconds_total[5m]) / rate(http_request_duration_seconds_average[5m])
  • D. rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_average[5m])
Answer:

A


Explanation:
In Prometheus, histograms and summaries expose metrics with _sum and _count suffixes to
represent total accumulated values and sample counts, respectively. To compute the average request
duration over a given time window (for example, 5 minutes), you divide the rate of increase of _sum
by the rate of increase of _count:
\text{Average duration} =
\frac{\text{rate(http_request_duration_seconds_sum[5m])}}{\text{rate(http_request_duration_seco
nds_count[5m])}}
Here,
http_request_duration_seconds_sum represents the total accumulated request time, and
http_request_duration_seconds_count represents the number of requests observed.
By dividing these rates, you obtain the average request duration per request over the specified time
range.
Reference:
Extracted and verified from Prometheus documentation – Querying Histograms and Summaries,
PromQL Rate Function, and Metric Naming Conventions sections.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 5

If the vector selector foo[5m] contains 1 1 NaN, what would max_over_time(foo[5m]) return?

  • A. It errors out.
  • B. 1
  • C. NaN
  • D. No answer.
Answer:

B


Explanation:
In PromQL, range vector functions like max_over_time() compute an aggregate value (in this case,
the maximum) over all samples within a specified time range. The function ignores NaN (Not-a-
Number) values when computing the result.
Given the range vector foo[5m] containing samples [1, 1, NaN], the maximum value among the valid
numeric samples is 1. Therefore, max_over_time(foo[5m]) returns 1.
Prometheus functions handle missing or invalid data points gracefully—ignoring NaN ensures stable
calculations even when intermittent collection issues or resets occur. The function only errors if the
selector is syntactically invalid or if no numeric samples exist at all.
Reference:
Verified from Prometheus documentation – PromQL Range Vector Functions, Aggregation Over Time
Functions, and Handling NaN Values in PromQL sections.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 6

Given the following Histogram metric data, how many requests took less than or equal to 0.1
seconds?
apiserver_request_duration_seconds_bucket{job="kube-apiserver", le="+Inf"} 3
apiserver_request_duration_seconds_bucket{job="kube-apiserver", le="0.05"} 0
apiserver_request_duration_seconds_bucket{job="kube-apiserver", le="0.1"} 1
apiserver_request_duration_seconds_bucket{job="kube-apiserver", le="1"} 3
apiserver_request_duration_seconds_count{job="kube-apiserver"} 3
apiserver_request_duration_seconds_sum{job="kube-apiserver"} 0.554003785

  • A. 0
  • B. 0.554003785
  • C. 1
  • D. 3
Answer:

C


Explanation:
In Prometheus, histogram metrics use cumulative buckets to record the count of observations that
fall within specific duration thresholds. Each bucket has a label le (“less than or equal to”),
representing the upper bound of that bucket.
In the given metric, the bucket labeled le="0.1" has a value of 1, meaning exactly one request took
less than or equal to 0.1 seconds. Buckets are cumulative, so:
le="0.05" → 0 requests ≤ 0.05 seconds
le="0.1" → 1 request ≤ 0.1 seconds
le="1" → 3 requests ≤ 1 second
le="+Inf" → all 3 requests total
The _sum and _count values represent total duration and request count respectively, but the number
of requests below a given threshold is read directly from the bucket’s le value.
Reference:
Verified from Prometheus documentation – Understanding Histograms and Summaries, Bucket
Semantics, and Histogram Query Examples sections.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 7

Which kind of metrics are associated with the function deriv()?

  • A. Counters
  • B. Gauges
  • C. Summaries
  • D. Histograms
Answer:

B


Explanation:
The deriv() function in PromQL calculates the per-second derivative of a time series using linear
regression over the provided time range. It estimates the instantaneous rate of change for metrics
that can both increase and decrease — which are typically gauges.
Because counters can only increase (except when reset), rate() or increase() functions are more
appropriate for them. deriv() is used to identify trends in fluctuating metrics like CPU temperature,
memory utilization, or queue depth, where values rise and fall continuously.
In contrast, summaries and histograms consist of multiple sub-metrics (e.g., _count, _sum, _bucket)
and are not directly suited for derivative calculation without decomposition.
Reference:
Extracted and verified from Prometheus documentation – PromQL Functions – deriv(),
Understanding Rates and Derivatives, and Gauge Metric Examples.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 8

Which metric type uses the delta() function?

  • A. Info
  • B. Histogram
  • C. Gauge
  • D. Counter
Answer:

C


Explanation:
The delta() function in PromQL calculates the difference between the first and last samples in a range
vector over a specified time window. This function is primarily used with gauge metrics, as they can
move both up and down, and delta() captures that net change directly.
For example, if a gauge metric like node_memory_Active_bytes changes from 1000 to 1200 within a
5-minute window, delta(node_memory_Active_bytes[5m]) returns 200.
Unlike rate() or increase(), which are designed for monotonically increasing counters, delta() is ideal
for metrics representing resource levels, capacities, or instantaneous measurements that fluctuate
over time.
Reference:
Verified from Prometheus documentation – PromQL Range Functions – delta(), Gauge Semantics and
Usage, and Comparing delta() and rate() sections.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 9

With the following metrics over the last 5 minutes:
up{instance="localhost"} 1 1 1 1 1
up{instance="server1"} 1 0 0 0 0
What does the following query return:
min_over_time(up[5m])

  • A. {instance="localhost"} 1 {instance="server1"} 0
  • B. {instance="server1"} 0
Answer:

A


Explanation:
The min_over_time() function in PromQL returns the minimum sample value observed within the
specified time range for each time series.
In the given data:
For up{instance="localhost"}, all samples are 1. The minimum value over 5 minutes is therefore 1.
For up{instance="server1"}, the sequence is 1 0 0 0 0. The minimum observed value is 0.
Thus, the query min_over_time(up[5m]) returns two series — one per instance:
{instance="localhost"} 1
{instance="server1"} 0
This query is commonly used to check uptime consistency. If the minimum value over the time
window is 0, it indicates at least one scrape failure (target down).
Reference:
Verified from Prometheus documentation – PromQL Range Vector Functions, min_over_time()
definition, and up Metric Semantics sections.

vote your answer:
A
B
A 0 B 0
Comments
Question 10

Which of the following PromQL queries is invalid?

  • A. max by (instance) up
  • B. max on (instance) (up)
  • C. max without (instance) up
  • D. max without (instance, job) up
Answer:

B


Explanation:
The max operator in PromQL is an aggregation operator, not a binary vector matching operator.
Therefore, the valid syntax for aggregation uses by() or without(), not on().

max by (instance) up → Valid; aggregates maximum values per instance.

max without (instance) up and max without (instance, job) up → Valid; aggregates over all labels
except those listed.

max on (instance) (up) → Invalid; the keyword on() is only valid in binary operations (e.g., +, -,
and, or, unless), where two vectors are being matched on specific labels.
Hence, max on (instance) (up) is a syntax error in PromQL because on() cannot be used directly with
aggregation operators.
Reference:
Verified from Prometheus documentation – Aggregation Operators, Vector Matching –
on()/ignoring(), and PromQL Language Syntax Reference sections.

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Page 1 out of 5
Viewing questions 1-10 out of 60
Go To
page 2