Prometheus Certified Associate (PCA) — Questions and Answers
Question 1: Which Prometheus service discovery mechanism discovers targets using Kubernetes API watch calls?
- http_sd_config
- file_sd_config
- dns_sd_config
- kubernetes_sd_config (Correct answer)
Correct answer: kubernetes_sd_config
`kubernetes_sd_config` uses the Kubernetes API to discover pods, services, endpoints, ingresses, and nodes as scrape targets.
Question 2: Which HTTP endpoint should you check on a Prometheus server to verify that a specific target is being scraped successfully?
- /api/v1/alerts
- /api/v1/targets (Correct answer)
- /metrics
- /api/v1/rules
Correct answer: /api/v1/targets
/api/v1/targets returns the current state of all scrape targets including their health status and last scrape error.
Question 3: Which exporter is commonly used to expose PostgreSQL database metrics for Prometheus?
- postgresql_exporter
- db_exporter
- sql_exporter
- postgres_exporter (Correct answer)
Correct answer: postgres_exporter
The `postgres_exporter` (by Prometheus Community) connects to PostgreSQL and exposes connection counts, query stats, replication lag, and more.
Question 4: What does the Prometheus blackbox_exporter probe?
- Internal application JVM metrics
- External endpoint availability via HTTP, HTTPS, DNS, TCP, and ICMP (Correct answer)
- Container runtime metrics
- Database query latency only
Correct answer: External endpoint availability via HTTP, HTTPS, DNS, TCP, and ICMP
The blackbox_exporter performs synthetic probes over HTTP(S), DNS, TCP, and ICMP to test external endpoint reachability and response time.
Question 5: A Grafana dashboard shows gaps in a Prometheus graph every hour. The target scrape is healthy. What is the most likely cause?
- The range query interval exceeds the scrape interval causing no-data gaps (Correct answer)
- The metric has a stale marker inserted every hour
- Prometheus is restarting every hour due to OOM
- The dashboard refresh rate is set to 1 hour
Correct answer: The range query interval exceeds the scrape interval causing no-data gaps
If the step (resolution) of a range query is larger than the scrape interval, Prometheus may find no samples in some steps, resulting in visible gaps.
Question 6: When Prometheus is deployed in a multi-cluster environment, which open-source project extends it with global query view and long-term storage without modifying the Prometheus binary?
- Grafana Mimir
- VictoriaMetrics
- Loki
- Thanos (Correct answer)
Correct answer: Thanos
Thanos sidecars attach to each Prometheus instance, uploading blocks to object storage and exposing a Store API, enabling a global query layer across clusters.
Question 7: What is stale marker handling in the context of Prometheus recording rules?
- When a source series disappears, Prometheus marks recorded outputs as stale so dashboards show gaps instead of stale values (Correct answer)
- It is a mechanism that replaces missing data points with the last known good value
- Stale markers are injected into WAL to signal block compaction boundaries
- Recording rules inject NaN values when source metrics exceed retention
Correct answer: When a source series disappears, Prometheus marks recorded outputs as stale so dashboards show gaps instead of stale values
Prometheus propagates staleness from input series to recording rule outputs, causing downstream metrics to also show as stale/missing when the source goes away.
Question 8: A Prometheus alert has been in the `PENDING` state for longer than the configured `for` duration but has not transitioned to `FIRING`. What is the most likely cause?
- The rule evaluation interval is longer than the for-duration
- Alertmanager is not reachable
- The alert condition became false before the for-duration elapsed (Correct answer)
- The alerting rule file has a syntax error
Correct answer: The alert condition became false before the for-duration elapsed
If the alert condition resolves before the for-duration completes, the alert resets to inactive without ever firing.
Question 9: What does the `__address__` label represent in Prometheus target discovery?
- The host:port used to scrape the target (Correct answer)
- The remote write endpoint
- The Alertmanager URL
- The Prometheus server's own address
Correct answer: The host:port used to scrape the target
`__address__` holds the `host:port` that Prometheus uses to construct the scrape URL for a target.
Question 10: What Prometheus label controls which Alertmanager instance a particular alert is routed to?
- __replica__
- There is no per-alert routing to specific Alertmanagers (Correct answer)
- __alertmanager__
- alertmanager_url
Correct answer: There is no per-alert routing to specific Alertmanagers
Prometheus sends all alerts to all configured Alertmanager instances; per-alert Alertmanager selection is not a Prometheus feature — routing is handled inside Alertmanager.
Question 11: Which Prometheus metric type is best suited for measuring request latency distributions with configurable quantile calculations?
- Histogram
- Counter
- Gauge
- Summary (Correct answer)
Correct answer: Summary
Summary calculates streaming quantiles (e.g., p50, p99) client-side and exposes them directly, making it suited when you need accurate per-instance quantiles.
Question 12: How does the `offset` modifier affect a PromQL query like `http_requests_total offset 1h`?
- It averages the metric over the past 1 hour
- It shifts the query evaluation time forward by 1 hour into the future
- It delays the alert firing by 1 hour
- It retrieves the metric value as it was 1 hour ago (Correct answer)
Correct answer: It retrieves the metric value as it was 1 hour ago
The `offset` modifier shifts the query's evaluation point backward in time, so `offset 1h` returns the value the metric had 1 hour ago.
Question 13: Which Grafana panel type is most appropriate for displaying a single current metric value such as the number of active connections?
- Time series
- Histogram
- Heatmap
- Stat (Correct answer)
Correct answer: Stat
The Stat panel displays a single large numeric value with optional coloring based on thresholds, ideal for KPI-style current metrics.
Question 14: What does Prometheus do when it encounters a 'stale marker' for a time series?
- It immediately deletes the series from storage
- It marks the series as stale and stops returning it in queries after the staleness window (Correct answer)
- It retains the last known value indefinitely
- It replaces the value with 0 until a new sample arrives
Correct answer: It marks the series as stale and stops returning it in queries after the staleness window
Prometheus sends stale markers when a target disappears, causing the series to be marked stale and excluded from query results after the staleness period (default 5 minutes).
Question 15: In Alertmanager, what is the difference between `resolve_timeout` and the `for` clause in a Prometheus alerting rule?
- for controls when an alert fires; resolve_timeout controls how long Alertmanager waits before marking it resolved (Correct answer)
- for applies only to critical alerts; resolve_timeout applies to all severities
- They are identical; one is an alias of the other
- resolve_timeout is set in Prometheus; for is set in Alertmanager
Correct answer: for controls when an alert fires; resolve_timeout controls how long Alertmanager waits before marking it resolved
The for clause in Prometheus determines how long a condition must be true before alerting, while resolve_timeout in Alertmanager sets how long to wait after the condition clears before sending a resolution notification.
Question 16: What is a dashboard in Grafana?
- A query tool
- A tool for storing data
- A configuration panel
- A visual representation of metrics (Correct answer)
Correct answer: A visual representation of metrics
The core purpose of monitoring with Prometheus is to systematically collect quantitative data (metrics) about the behavior and health of systems and applications. By continuously gathering these metrics, Prometheus enables users to observe performance trends, identify bottlenecks, detect anomalies, and ensure the overall stability and efficiency of their infrastructure. This comprehensive data collection forms the foundation of effective system management.
Question 17: Which Prometheus web configuration file field specifies the path to the server's TLS certificate?
- server_certificate
- tls_cert
- ssl_cert_path
- cert_file (Correct answer)
Correct answer: cert_file
The cert_file field in the web configuration YAML points to the PEM-encoded TLS certificate file for the Prometheus server.
Question 18: What is the recommended approach for instrumenting a new Go application with Prometheus?
- Use the Pushgateway for all application metrics
- Import the prometheus/client_golang library and register metrics with the default registry (Correct answer)
- Write metrics to a file for file_sd to pick up
- Embed the statsd_exporter as a sidecar
Correct answer: Import the prometheus/client_golang library and register metrics with the default registry
The official `prometheus/client_golang` library provides Counter, Gauge, Histogram, and Summary types that auto-register with the default registry and expose via an HTTP handler.
Question 19: When visualizing metrics in Grafana, what does 'legend format' allow you to customize?
- The color and line style of each time series
- The Y-axis unit and scale for the panel
- The tooltip content shown on hover
- The display name of each series in the legend using label values (Correct answer)
Correct answer: The display name of each series in the legend using label values
Legend format lets you define a template using label names (e.g., `{{instance}} - {{job}}`) to create meaningful legend labels for each time series.
Question 20: Which exporter is the standard choice for exposing Linux host-level metrics such as CPU, memory, and disk?
- host_exporter
- node_exporter (Correct answer)
- blackbox_exporter
- process_exporter
Correct answer: node_exporter
The `node_exporter` exposes a comprehensive set of hardware and OS metrics from Linux/Unix hosts via `/proc` and `/sys`.
Question 21: What is 'relabeling' used for in Prometheus's scrape configuration?
- Compressing WAL segments
- Transforming or filtering labels on targets or scraped samples before storage (Correct answer)
- Renaming TSDB block files on disk
- Assigning alert severity levels
Correct answer: Transforming or filtering labels on targets or scraped samples before storage
Relabeling (relabel_configs and metric_relabel_configs) allows operators to add, rename, drop, or filter labels at scrape time before samples are stored.
Question 22: What is the correct PromQL syntax for a subquery that evaluates `rate(http_requests_total[5m])` over the last 1 hour at 1-minute resolution?
- `rate(http_requests_total[5m:1m])[1h]`
- `rate(http_requests_total[5m])[1h:1m]` (Correct answer)
- `rate(http_requests_total[5m])[1h]`
- `subquery(rate(http_requests_total[5m]), 1h, 1m)`
Correct answer: `rate(http_requests_total[5m])[1h:1m]`
Subquery syntax appends `[range:resolution]` to a range expression, so `[1h:1m]` evaluates the inner expression over 1 hour at 1-minute steps.
Question 23: Which flag controls how long Prometheus retains data when using time-based retention?
- --storage.tsdb.retention.time (Correct answer)
- --tsdb.retention-days
- --storage.local.retention
- --storage.tsdb.max-age
Correct answer: --storage.tsdb.retention.time
The --storage.tsdb.retention.time flag specifies the maximum age of data blocks before they are deleted.
Question 24: What is the purpose of `ca_file` in a Prometheus tls_config block?
- It lists the cipher algorithms allowed during scraping
- It specifies the CA certificate used to verify the target's TLS certificate (Correct answer)
- It names the Kubernetes secret containing TLS credentials
- It defines the certificate authority for Prometheus's own HTTPS server
Correct answer: It specifies the CA certificate used to verify the target's TLS certificate
ca_file provides the CA bundle that Prometheus uses to validate the server certificate presented by scrape targets.
Question 25: In Prometheus HTTP service discovery (`http_sd_config`), what must the HTTP endpoint return?
- A YAML list of scrape_configs
- A DNS zone file
- A Prometheus exposition format response
- A JSON array of target groups with labels (Correct answer)
Correct answer: A JSON array of target groups with labels
`http_sd_config` expects the endpoint to return a JSON array of target group objects, each with a `targets` list and optional `labels` map.
Question 26: What is the recommended naming convention for a recording rule that pre-computes `sum(rate(http_requests_total[5m])) by (job)`?
- `http_requests_total_rate_5m_sum`
- `recording_rule_http_requests_total`
- `job:http_requests_total:rate5m` (Correct answer)
- `http_requests_sum_by_job`
Correct answer: `job:http_requests_total:rate5m`
Prometheus recommends the naming pattern `level:metric:operations` for recording rules, where level is the aggregation label, metric is the base metric, and operations describe the transformations applied.
Question 27: Which exporter is the standard choice for exposing Linux/Unix host-level metrics (CPU, memory, disk) to Prometheus?
- Pushgateway
- Node Exporter (Correct answer)
- cAdvisor
- Blackbox Exporter
Correct answer: Node Exporter
Node Exporter is the official Prometheus exporter that reads /proc and /sys to expose hardware and OS metrics from Linux hosts.
Question 28: When troubleshooting a failing alerting rule, which Prometheus API endpoint provides the current evaluation state and any errors for alerting rules?
- /api/v1/alerts
- /api/v1/rules (Correct answer)
- /api/v1/targets
- /api/v1/query
Correct answer: /api/v1/rules
/api/v1/rules returns all loaded alerting and recording rules along with their current state, last evaluation time, and any evaluation errors.
Question 29: In a Prometheus rule file, which YAML key defines a recording rule's output metric name?
- name
- record (Correct answer)
- metric
- output
Correct answer: record
The `record` key in a rule group entry specifies the name of the new time series that the rule's expression will be written to.
Prometheus Certified Associate (PCA)
The PCA certifies foundational knowledge of Prometheus monitoring and observability, covering PromQL, Prometheus architecture, instrumentation, exporters, and alerting. It is offered by the Linux Foundation and CNCF.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds