All Linux Foundation / CNCF exams

Free PCA practice test: 30 questions with answers

30 original questions for Prometheus Certified Associate, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.

Free questions
30
Full bank
100 questions

PCA exam guide: topics, cost and format

All 30 PCA questions with answers

The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.

Observability and Prometheus fundamentals (8 questions)

  1. Question 1

    Prometheus collects metrics using a pull model. What does this mean?

    1. ATargets push every metric to Prometheus as soon as it changes over a connection each target opens
    2. BMetrics are sent through weekly e-mail summaries emailed to an operator
    3. CThe Prometheus server scrapes HTTP endpoints exposed by targets at a set interval
    4. DPrometheus reads metric values from the target's local disk directly
    Show answer and explanation
    Correct answer: C

    In the pull model, the Prometheus server periodically scrapes metrics endpoints on targets. Push-based systems send data from the target, email is not a metrics transport, and Prometheus does not read target disks.

  2. Question 2

    In Prometheus, what is a time series identified by?

    1. AA hostname with no label set
    2. BA metric name and a set of labels
    3. CA file name and a time stamp
    4. DA user's email address and birthdate
    Show answer and explanation
    Correct answer: B

    A Prometheus time series is identified by its metric name and its label set. File names, email addresses and hostnames without labels do not define a series.

  3. Question 3

    Which Prometheus metric type is used for a value that can go up and down, such as the number of active connections?

    1. ACounter
    2. BInfo metric only
    3. CHistogram summary only
    4. DGauge
    Show answer and explanation
    Correct answer: D

    A gauge represents a value that can increase or decrease. A counter only increases (except on reset), histogram summaries track distributions, and info metrics carry metadata.

  4. Question 4

    Which Prometheus metric type should be used for the total number of HTTP requests served since the process started?

    1. AGauge
    2. BCounter
    3. CSummary with no quantiles
    4. DLabel value
    Show answer and explanation
    Correct answer: B

    A counter is designed for monotonically increasing totals such as requests served. A gauge can go down, and labels are not metric types.

  5. Question 5

    A prometheus.yml configuration defines scrape targets. Which section specifies how often Prometheus scrapes them by default?

    1. Aremote_write with queue_capacity
    2. Bglobal with scrape_interval
    3. Calerting with alertmanager_url
    4. Drule_files with rules_dir
    Show answer and explanation
    Correct answer: B

    The global section sets default values such as scrape_interval for all jobs. Alerting, rule files and remote write are separate sections.

  6. Question 6

    A team wants Prometheus to discover targets automatically from a Kubernetes cluster rather than maintaining a static list. Which configuration mechanism is used?

    1. AA cron job which copies IP addresses into a file
    2. BManually editing the target list each morning
    3. CKubernetes service discovery in the scrape configuration
    4. DUsing the static_configs section with a fixed list of IP addresses
    Show answer and explanation
    Correct answer: C

    Kubernetes service discovery finds targets dynamically. Manual edits, copied IPs and static lists require ongoing maintenance and do not adapt to cluster changes.

  7. Question 7

    Which component is responsible for sending alert notifications to receivers such as email or chat after Prometheus fires alerts?

    1. ANode exporter
    2. BGrafana panels only
    3. CPushgateway
    4. DAlertmanager
    Show answer and explanation
    Correct answer: D

    Alertmanager receives firing alerts and routes notifications to receivers. Node exporter exposes host metrics, Pushgateway accepts pushed metrics for batch jobs, and Grafana panels visualize data.

  8. Question 8

    A batch job runs for a short time and cannot be scraped reliably. Which component allows the job to push its metrics for Prometheus to collect?

    1. ABlackbox exporter
    2. BPushgateway
    3. CNode exporter
    4. DAlertmanager
    Show answer and explanation
    Correct answer: B

    Pushgateway holds metrics pushed by short-lived jobs so Prometheus can scrape them. Blackbox exporter probes endpoints, node exporter reports host metrics, and Alertmanager handles notifications.

PromQL and querying (8 questions)

  1. Question 9

    A team wants the per-second rate of HTTP requests from a counter over the last five minutes. Which PromQL expression is appropriate?

    1. Ahttp_requests_total + 5m
    2. Bsum(http_requests_total) by minute
    3. Cavg_over_time(http_requests_total)
    4. Drate(http_requests_total[5m])
    Show answer and explanation
    Correct answer: D

    rate() computes the per-second average increase of a counter over a range, which suits request rates. Adding a duration, invalid sum syntax and avg_over_time without a range are incorrect.

  2. Question 10

    A query must show the total request rate across all instances of a service, grouped by HTTP status code. Which PromQL pattern does this?

    1. Asum by (status_code) (rate(http_requests_total[5m]))
    2. Bmax by (job) (up{job="api-server", env="prod", pod="api-1"})
    3. Ccount(increase(up{job="api-gateway-v2"}[12h]))
    4. Dcount by (job) (http_requests_total{code="200", handler="/v1"})
    Show answer and explanation
    Correct answer: A

    sum by (status_code) of a rate aggregates across instances, grouped by status code. Count alone, max of up and ungrouped increases do not answer the question.

  3. Question 11

    A team wants to know whether a target is up. Which metric does Prometheus generate for every scrape to indicate success?

    1. Atarget_status
    2. Bscrape_ok_total
    3. Cup
    4. Dhealth_check
    Show answer and explanation
    Correct answer: C

    Prometheus generates the up metric for each target, with 1 for a successful scrape and 0 for failure. The other names are not standard built-in metrics.

  4. Question 12

    A histogram exposes buckets for request durations. Which function estimates the 95th percentile latency from those buckets?

    1. Acount(server_duration_ms)
    2. Bavg(server_duration_ms_sum)
    3. Chistogram_quantile(0.95, ...)
    4. Dsum(request_duration_ms)
    Show answer and explanation
    Correct answer: C

    histogram_quantile estimates quantiles from histogram buckets. Average, count and sum do not compute percentiles directly.

  5. Question 13

    A PromQL query returns a vector with many series. An engineer wants to keep only series where the value is greater than 100. Which operator achieves this filter?

    1. AA comparison operator such as > with the threshold
    2. BA string concatenation with the metric name
    3. CA logical AND operator using the keyword filter in a query
    4. DA division by zero that is applied to each series in data
    Show answer and explanation
    Correct answer: A

    Comparison operators like > filter vector elements that meet the condition. The other options are not PromQL filters.

  6. Question 14

    A team wants to match series between two metrics that share labels, such as instance and job, and divide them. Which operation is designed for this?

    1. AVector matching with on() or ignoring() in a binary operation
    2. BConcatenating the metric names into one combined label
    3. CReading the raw TSDB chunk files from the local disk
    4. DSorting the returned series by timestamp in ascending order for display
    Show answer and explanation
    Correct answer: A

    Vector matching with on() or ignoring() pairs series with matching labels for binary operations such as division. Concatenation, sorting and raw file reads are not PromQL matching.

  7. Question 15

    A dashboard should show the current memory use of each instance as a percentage of its total memory. Which expression best fits this need?

    1. Acount by (instance, mode) (node_cpu_seconds_total{mode="idle"})
    2. Bnode_memory_MemTotal_bytes{job="node-exporter", instance=~"web-eu-12.*"} * 100
    3. Crate(node_memory_MemTotal_bytes{job="node-exporter"}[10m])
    4. D(1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) * 100
    Show answer and explanation
    Correct answer: D

    Using available and total memory computes the used percentage per instance. Multiplying the total alone, using rate on a gauge and counting CPUs do not produce the percentage.

  8. Question 16

    A team uses increase() on a counter to compute how many requests occurred in the last hour. Which property should they understand about counters?

    1. ACounters cannot be used with range vectors, so increase() and rate() are unavailable
    2. BCounters store text values as labels attached to time series
    3. CCounters decrease in value over time as older samples are compacted out of storage
    4. DCounters reset to zero on restart, and increase() accounts for resets
    Show answer and explanation
    Correct answer: D

    Counters can reset on process restart, and rate and increase handle resets. Counters increase, can be used with ranges, and store numeric values.

Alerting and visualization (7 questions)

  1. Question 17

    An alert should fire only if the error rate stays above a threshold for five minutes. Which alert rule element implements this?

    1. AThe labels section with a severity and team value
    2. BThe for clause with a duration of five minutes
    3. CThe receiver name set in the Alertmanager route tree
    4. DThe annotations section holding a summary and runbook URL
    Show answer and explanation
    Correct answer: B

    The for clause requires the condition to hold for a specified duration before the alert fires. Annotations provide descriptions, labels classify alerts, and receivers are notification endpoints.

  2. Question 18

    Alertmanager receives many similar alerts from one outage. The team wants one grouped notification instead of many. Which feature provides this?

    1. AGrouping by labels in the route configuration
    2. BTurning off all notifications
    3. CSending each alert to a different email address
    4. DDisabling Alertmanager
    Show answer and explanation
    Correct answer: A

    Grouping by labels combines related alerts into one notification. Separate addresses, disabling Alertmanager and turning off notifications do not reduce the noise in a sensible way.

  3. Question 19

    During planned maintenance, the team wants to temporarily mute alerts for a specific service without changing the alert rules. Which Alertmanager feature should be used?

    1. AA silence matching the service labels for a defined period
    2. BShutting down the Prometheus server for the duration
    3. CDisabling the email receivers permanently in the file
    4. DDeleting the alert rule files from the Prometheus server
    Show answer and explanation
    Correct answer: A

    Silences mute matching alerts for a time window without changing rules. Deleting rules, shutting down Prometheus and permanent disabling are heavier-handed and risk missing real incidents.

  4. Question 20

    A dashboard in Grafana uses Prometheus as a data source. Which setting connects them?

    1. AUse only static images for the dashboard
    2. BCopy the metrics into a spreadsheet
    3. CInstall the Prometheus binary inside each dashboard
    4. DAdd Prometheus as a data source with its server URL
    Show answer and explanation
    Correct answer: D

    Grafana connects to Prometheus through a data source configured with its URL. Spreadsheets, embedding the binary in dashboards and static images do not provide live queries.

  5. Question 21

    A team wants to be notified when a certificate will expire in fourteen days. Which approach fits Prometheus monitoring?

    1. AA metric exposing the expiry time with an alert when the remaining time falls below fourteen days
    2. BWaiting for users to report errors or failed requests before anyone investigates the certificate expiry date
    3. CA recurring reminder in a team calendar with no metric or alert attached to the certificate expiry date
    4. DDisabling certificate checks on the load balancer to reduce monitoring overhead during the peak traffic period
    Show answer and explanation
    Correct answer: A

    An expiry metric with an alert gives timely, automated notification. Calendars without metrics, waiting for reports and disabling checks do not meet the need.

  6. Question 22

    A team needs an alert for when a scrape target stops responding. Which built-in metric and condition are used?

    1. Aup equal to 0 for the target
    2. Brate of CPU usage above 90 percent
    3. CNumber of dashboards
    4. DDisk free above 50 percent
    Show answer and explanation
    Correct answer: A

    The up metric drops to 0 when a scrape fails, which is the standard way to alert on unreachable targets. CPU, disk and dashboard counts do not indicate scrape failure.

  7. Question 23

    A recording rule and an alerting rule are both defined. Which statement is accurate?

    1. ANeither rule type can use PromQL expressions, so both must be written in a separate query language used by Alertmanager
    2. BAlerting rules store series and recording rules send emails through Alertmanager
    3. CBoth rules produce alert notifications and no new time series data for downstream queries in Prometheus
    4. DRecording rules store computed series, while alerting rules evaluate conditions and fire alerts
    Show answer and explanation
    Correct answer: D

    Recording rules produce new series from expressions, and alerting rules evaluate conditions to fire alerts. Both use PromQL and only one produces alerts.

Instrumentation and exporters (7 questions)

  1. Question 24

    A developer adds a counter to an application to track failed payments. Which label design is recommended?

    1. AUse a random UUID generated for each incoming request as a label value in the metric
    2. BUse a small, bounded set of label values such as payment provider and region
    3. CUse each customer's email address as a label on every failed payment
    4. DUse the full raw request body as a label on the failed payment counter
    Show answer and explanation
    Correct answer: B

    Bounded labels keep cardinality manageable. Emails, random UUIDs and request bodies create high-cardinality series that strain Prometheus.

  2. Question 25

    A service needs to report how long requests take, with the ability to compute percentiles on the server side. Which metric type is most suitable?

    1. AHistogram
    2. BLabel set
    3. CInfo metric
    4. DCounter with no buckets
    Show answer and explanation
    Correct answer: A

    Histograms store bucketed observations that allow quantiles to be computed with histogram_quantile. A counter alone does not capture distribution, and info metrics and label sets are not timing types.

  3. Question 26

    A system's metrics include disk usage in megabytes for one service and bytes for another. What is the recommended practice?

    1. ARemove all units from metric names and label values
    2. BLet each team choose its own unit for its metrics
    3. CStore sample values as text strings in the TSDB
    4. DUse base units such as bytes consistently across metrics
    Show answer and explanation
    Correct answer: D

    Consistent base units such as bytes simplify comparison and aggregation. Team-specific units, unitless names and text values make cross-service metrics hard to use.

  4. Question 27

    A third-party database provides no native Prometheus endpoint. Which approach exposes its metrics to Prometheus?

    1. ADisable monitoring for the database and rely on application-level health checks to detect its availability
    2. BAsk Prometheus to read the database's log files directly from disk on each scrape cycle and parse matching lines
    3. CRun a dedicated exporter that queries the database and exposes metrics in the Prometheus format
    4. DInstall Alertmanager directly on the database server so that it can route the database's internal alert events
    Show answer and explanation
    Correct answer: C

    A dedicated exporter translates database statistics into Prometheus metrics. Prometheus does not read logs directly, Alertmanager sends notifications, and disabling monitoring removes visibility.

  5. Question 28

    A Prometheus exporter is needed to expose metrics for containers running on a host, including CPU and memory per container. Which exporter is commonly used?

    1. ABlackbox exporter
    2. BcAdvisor
    3. CPushgateway
    4. DAlertmanager
    Show answer and explanation
    Correct answer: B

    cAdvisor exposes per-container resource metrics. Blackbox probes endpoints, Pushgateway receives pushed metrics, and Alertmanager sends notifications.

  6. Question 29

    A metrics endpoint should only be reachable by the Prometheus server, not by the public internet. Which control is most appropriate?

    1. AUse a random high-numbered port that is published in the project README docs
    2. BRestrict access through network rules or authentication in front of the metrics endpoint
    3. CExpose the endpoint publicly on every network interface with no firewall rules, TLS, or authentication enabled
    4. DDisable scraping of the endpoint in the scrape configuration for the job
    Show answer and explanation
    Correct answer: B

    Network rules or authentication limit access to the metrics endpoint. Public exposure, obscurity and disabling scraping are weaker or break monitoring.

  7. Question 30

    Scrape targets are configured with a relabelling rule that drops a label containing a sensitive value before storage. What is this called?

    1. ARemote read from a storage backend
    2. BFederation of a subset of series
    3. CRelabelling in the scrape configuration
    4. DAlert silencing configured in the Alertmanager
    Show answer and explanation
    Correct answer: C

    Relabelling rules transform or drop labels during scraping, which can remove sensitive values before storage. Silencing suppresses alerts, remote read queries data, and federation copies series between servers.