Limited-Time Offer: Enjoy 50% Savings! Ends in 00h 00m 00s Coupon code: 50OFF
Skip to content

Free Linux Foundation Prometheus Certified Associate PCA Exam Questions

Page: 1 / 6 Total 60 questions

Want more questions? Get Premium Access.

Question 1

Given the metric prometheus_tsdb_lowest_timestamp_seconds, how do you know in which month the lowest timestamp of your Prometheus TSDB belongs?

Correct Answer: D. (time() - prometheus_tsdb_lowest_timestamp_seconds) / 86400
Explanation:

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) / 86400

converts 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.

Question 2

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

Correct Answer: B. 1
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.


Verified from Prometheus documentation -- PromQL Range Vector Functions, Aggregation Over Time Functions, and Handling NaN Values in PromQL sections.

Question 3

What is a difference between a counter and a gauge?

Correct Answer: D. Counters are only incremented, while gauges can go up and down.
Explanation:

The key difference between a counter and a gauge in Prometheus lies in how their values change over time. A counter is a cumulative metric that only increases---it resets to zero only when the process restarts. Counters are typically used for metrics like total requests served, bytes processed, or errors encountered. You can derive rates of change from counters using functions like rate() or increase() in PromQL.

A gauge, on the other hand, represents a metric that can go up and down. It measures values that fluctuate, such as CPU usage, memory consumption, temperature, or active session counts. Gauges provide a snapshot of current state rather than a cumulative total.

This distinction ensures proper interpretation of time-series trends and prevents misrepresentation of one-time or fluctuating values as cumulative metrics.


Extracted and verified from Prometheus official documentation -- Metric Types section explaining Counters and Gauges definitions and usage examples.

Question 4

What is the maximum number of Alertmanagers that can be added to a Prometheus instance?

Correct Answer: A. More than 3
Explanation:

Prometheus supports integration with multiple Alertmanager instances for redundancy and high availability. The alerting section of the Prometheus configuration file (prometheus.yml) allows specifying a list of Alertmanager targets, enabling Prometheus to send alerts to several Alertmanager nodes simultaneously.

There is no hard-coded limit on the number of Alertmanagers that can be added. The typical best practice is to run a minimum of three Alertmanagers in a clustered setup to achieve fault tolerance and ensure reliable alert delivery, but Prometheus can be configured with more than three if desired.

Each Alertmanager node in the cluster communicates state information (active, silenced, inhibited alerts) with its peers to maintain consistency.


Verified from Prometheus documentation -- Alertmanager Integration, High Availability Setup, and Prometheus Configuration -- alerting Section.

Question 5

Which field in alerting rules files indicates the time an alert needs to go from pending to firing state?

Correct Answer: D. for
Explanation:

In Prometheus alerting rules, the for field specifies how long a condition must remain true continuously before the alert transitions from the pending to the firing state. This feature prevents transient spikes or brief metric fluctuations from triggering false alerts.

Example:

alert: HighRequestLatency

expr: http_request_duration_seconds_avg > 1

for: 5m

labels:

severity: warning

annotations:

description: 'Request latency is above 1s for more than 5 minutes.'

In this configuration, Prometheus evaluates the expression every rule evaluation cycle. The alert only fires if the condition (http_request_duration_seconds_avg > 1) remains true for 5 consecutive minutes. If it returns to normal before that duration, the alert resets and never fires.

This mechanism adds stability and noise reduction to alerting systems by ensuring only sustained issues generate notifications.


Verified from Prometheus documentation -- Alerting Rules Configuration Syntax, Pending vs. Firing States, and Best Practices for Alert Timing and Thresholds sections.

Question 6

What does the increase() function do in PromQL?

Correct Answer: B. Returns the absolute increase in a counter over a specified range.
Explanation:

The increase() function computes the total increase in a counter metric over a specified range vector. It accounts for counter resets and only measures the net change in the counter's value during the time window.

Example:

increase(http_requests_total[5m])

This query returns how many HTTP requests occurred in the last five minutes. Unlike rate(), which provides a per-second average rate, increase() gives the absolute number of increments.


Question 7

What are Inhibition rules?

Correct Answer: A. Inhibition rules mute a set of alerts when another matching alert is firing.
Explanation:

Inhibition rules in Prometheus's Alertmanager are used to suppress (mute) alerts that would otherwise be redundant when a higher-priority or related alert is already active. This feature helps avoid alert noise and ensures that operators focus on the root cause rather than multiple cascading symptoms.

For example, if a ''DatacenterDown'' alert is firing, inhibition rules can mute all ''InstanceDown'' alerts that share the same datacenter label, preventing redundant notifications. Inhibition is configured in the Alertmanager configuration file under the inhibit_rules section.

Each rule defines:

A source match (the alert that triggers inhibition),

A target match (the alert to mute), and

A match condition (labels that must be equal for inhibition to apply).

Only when the source alert is active are the target alerts silenced.


Verified from Prometheus documentation -- Alertmanager Configuration -- Inhibition Rules, Alert Deduplication and Grouping, and Alert Routing Best Practices.

Question 8

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

Correct Answer: A. {instance='localhost'} 1 {instance='server1'} 0
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).


Verified from Prometheus documentation -- PromQL Range Vector Functions, min_over_time() definition, and up Metric Semantics sections.

Question 9

How many metric types does Prometheus text format support?

Correct Answer: B. 4
Explanation:

Prometheus defines four core metric types in its official exposition format, which are: Counter, Gauge, Histogram, and Summary. These types represent the fundamental building blocks for expressing quantitative measurements of system performance, behavior, and state.

A Counter is a cumulative metric that only increases (e.g., number of requests served).

A Gauge represents a value that can go up and down, such as memory usage or temperature.

A Histogram samples observations (e.g., request durations) and counts them in configurable buckets, providing both counts and sum of observed values.

A Summary is similar to a histogram but provides quantile estimation over a sliding time window along with count and sum metrics.

These four types are the only officially supported metric types in the Prometheus text exposition format as defined by the Prometheus data model. Any additional metrics or custom naming conventions are built on top of these core types but do not constitute new types.


Extracted and verified from Prometheus official documentation sections on Metric Types and Exposition Formats in the Prometheus study materials.

Question 10

What function calculates the tp-quantile from a histogram?

Correct Answer: A. histogram_quantile()
Explanation:

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.