Prometheus Certified Associate study materials
Prometheus Certified Associate study resources

Prometheus Certified Associate practice questions

One question at a time. Build your Prometheus Certified Associate understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Observability Concepts

In Prometheus terminology, what is a 'sample'?

  1. A running Prometheus server process
  2. A single timestamped value belonging to a time series Correct answer.
  3. A scrape configuration block
  4. A dashboard panel rendered from a query

Explanation

A sample is the atomic data point in Prometheus: a float64 value paired with a millisecond timestamp, always associated with a specific time series identified by its label set. Metrics storage, querying, and retention all operate on samples.

Question 2Observability Concepts

A metric named http_requests_total with labels {method="GET", status="200"} is best described as what?

  1. A label
  2. A time series Correct answer.
  3. A target
  4. An alert rule

Explanation

A time series is uniquely identified by the metric name plus its complete label set, so http_requests_total{method="GET",status="200"} names one series. Every distinct label combination creates a separate series.

Question 3Observability Concepts

Which Prometheus metric type is appropriate for a value that can go up and down, such as current memory usage in bytes?

  1. Histogram
  2. Summary
  3. Gauge Correct answer.
  4. Counter

Explanation

A gauge represents a value that can arbitrarily increase or decrease, such as temperature, queue depth, or memory usage. Counters only increase, while histograms and summaries aggregate observations into buckets or quantiles.

Question 4Observability Concepts

What does the Prometheus exposition format require for a counter metric name by convention?

  1. A _sum suffix
  2. A _total suffix Correct answer.
  3. A _bucket suffix
  4. A _count suffix

Explanation

Counters conventionally end in _total, and client libraries such as the Go client enforce this convention. Histograms expose _bucket, _sum, and _count suffixes as part of their generated series.

Question 5Observability Concepts

In a PromQL expression, what does the rate() function compute when applied to a counter?

  1. The per-second average increase over the range, accounting for counter resets Correct answer.
  2. The total number of samples within the range vector
  3. The instantaneous value of the counter at the evaluation timestamp
  4. The maximum value observed in the range

Explanation

rate() takes a range vector of a counter and returns the average per-second increase across that window, extrapolating to the window boundaries and correcting for counter resets. It requires at least two samples in the range.

Question 6Observability Concepts

What is the purpose of a Prometheus scrape interval?

  1. It defines the timeout for alert notifications
  2. It defines the refresh rate of the expression browser
  3. It defines how long samples are retained in storage
  4. It defines how often Prometheus collects metrics from a target Correct answer.

Explanation

The scrape_interval sets how frequently Prometheus issues an HTTP request to each target's metrics endpoint and ingests the returned samples. Retention and alerting behavior are governed by separate settings.

Question 7Observability Concepts

Which component is responsible for routing, grouping, and silencing alerts in a typical Prometheus deployment?

  1. The node exporter
  2. Alertmanager Correct answer.
  3. The Prometheus server itself
  4. The pushgateway

Explanation

Prometheus evaluates alerting rules and forwards firing alerts to Alertmanager, which handles deduplication, grouping, inhibition, silencing, and routing to receivers. The Prometheus server does not deliver notifications directly.

Question 8Observability Concepts

What distinguishes observability from basic monitoring in the context of the Prometheus ecosystem?

  1. Observability is only achievable with distributed tracing, while monitoring uses metrics alone
  2. Observability requires log aggregation, while monitoring requires only metrics
  3. Observability lets you answer novel questions about internal state from telemetry, while monitoring tracks known conditions Correct answer.
  4. Observability relies only on pre-defined dashboards, while monitoring uses ad hoc queries

Explanation

Monitoring typically checks known failure modes against predefined thresholds, whereas observability is the ability to explore and answer unanticipated questions using the telemetry a system emits. Metrics, logs, and traces together support that capability.

Question 9Observability Concepts

An operator wants to record the result of an expensive PromQL expression so that dashboards can query it cheaply later. Which feature should be used?

  1. Service discovery
  2. Recording rules Correct answer.
  3. Alerting rules
  4. Relabeling rules

Explanation

Recording rules periodically evaluate a PromQL expression and store the result as a new time series, which avoids recomputing costly queries at dashboard load time. Alerting rules evaluate expressions to fire alerts rather than to persist derived series.

Question 10Observability Concepts

A team needs to count how many requests completed within each latency bucket. Which metric type should the application expose?

  1. Gauge
  2. Counter
  3. Histogram Correct answer.
  4. Summary

Explanation

A histogram exposes cumulative bucket counters so that queries can compute counts per bucket and aggregate across instances using histogram_quantile(). This makes it suitable for server-side aggregation of latency distributions.

Question 11Observability Concepts

Given the expression sum by (job) (rate(http_requests_total[5m])), what does the query return?

  1. The number of targets labeled with each job
  2. The total request count per job over the last five minutes
  3. The per-second request rate summed per job over a five-minute window Correct answer.
  4. The maximum request rate observed per job

Explanation

rate() converts the counter into a per-second increase over the five-minute range, and sum by (job) aggregates those rates across all series sharing each job label. The result is one value per job at each evaluation step.

Question 12Observability Concepts

What is the effect of the offset modifier in the expression node_cpu_seconds_total offset 1h?

  1. It delays ingestion of samples by one hour
  2. It limits the query range to the last hour
  3. It adds one hour to every sample timestamp at scrape time
  4. It shifts the query evaluation to data from one hour earlier Correct answer.

Explanation

The offset modifier moves the evaluation point back in time, so the selector reads values as they were one hour ago. This is commonly used to compare current behavior against a previous period.

Question 13Observability Concepts

Why is the pushgateway generally discouraged for short-lived batch jobs that can be scraped reliably?

  1. It holds the last pushed values indefinitely, which can make stale data appear current Correct answer.
  2. It converts counters into gauges automatically
  3. It cannot accept metrics from batch jobs at all
  4. It bypasses label validation entirely

Explanation

The pushgateway retains pushed metrics until they are explicitly deleted, so a finished job's values can persist and mislead queries. Prometheus documentation recommends push only for jobs that cannot be scraped, and deleting pushed series after use.

Question 14Observability Concepts

Which label should generally be avoided on high-cardinality metrics such as HTTP request counters?

  1. The HTTP status code
  2. A unique user identifier Correct answer.
  3. The HTTP method
  4. The handler route

Explanation

Labels with unbounded values, such as user IDs or raw URLs, multiply the number of time series and strain memory and storage. Low-cardinality dimensions like method, status, and route are the intended label choices.

Question 15Observability Concepts

What does the for clause in a Prometheus alerting rule specify?

  1. How often the rule expression is evaluated
  2. Which Alertmanager receiver handles the alert
  3. The maximum number of alerts that may fire at once
  4. How long the alert must remain firing before notifications are sent Correct answer.

Explanation

The for clause introduces a pending period: the expression must remain true for that duration before the alert transitions to firing. This suppresses transient spikes that would otherwise page responders.

Question 16Observability Concepts

A query returns no data for a series that exists, and the operator suspects the lookback delta. What does the default lookback delta control?

  1. The maximum duration allowed for a range selector
  2. How far back Prometheus looks for the most recent sample when evaluating an instant vector selector Correct answer.
  3. How long samples are kept before compaction
  4. How long Alertmanager waits before resolving an alert

Explanation

When an instant vector selector is evaluated, Prometheus uses the newest sample within the lookback delta window, five minutes by default. If no sample falls inside that window, the series is treated as absent for that evaluation.

Question 17Observability Concepts

Which service discovery mechanism would let Prometheus find targets from a Kubernetes API without static configuration?

  1. kubernetes_sd_configs Correct answer.
  2. Static config
  3. Relabeling
  4. File-based discovery

Explanation

kubernetes_sd_configs lets Prometheus query the Kubernetes API to discover pods, services, endpoints, and nodes as scrape targets. Relabeling then filters and shapes the discovered targets.

Question 18Observability Concepts

In the exposition format, what does a line beginning with # HELP before a metric describe?

  1. A directive that hides the metric from scraping
  2. An aggregation instruction for the server
  3. A sample value with a comment marker
  4. A comment containing free-text documentation for the metric Correct answer.

Explanation

The # HELP line carries human-readable documentation about the metric and is parsed as metadata rather than as a sample. The # TYPE line separately declares the metric type.

Question 19Observability Concepts

An operator applies the relabeling action labeldrop on the label __meta_kubernetes_pod_name. What is the result?

  1. The target is dropped from scraping
  2. The label is removed from the target's label set Correct answer.
  3. The metric is excluded from queries
  4. The label value is renamed to pod_name

Explanation

The labeldrop action removes matching labels from the target label set during relabeling. Dropping a whole target requires the drop action on a source label such as __address__.

Question 20Observability Concepts

What does the absent() function help detect in an alerting expression?

  1. Whether a series is missing at evaluation time Correct answer.
  2. Whether a histogram bucket is empty
  3. Whether a counter has been reset
  4. Whether a label value is duplicated

Explanation

absent() returns a vector with a single sample when its argument produces no series, which is useful for alerting on missing metrics or down targets. It returns an empty result when the input is present.

Question 21Observability Concepts

In Prometheus storage, what is a block?

  1. A group of alerting rules evaluated together
  2. A single scrape response body
  3. An immutable on-disk unit of time-series data covering a time range Correct answer.
  4. A batch of targets discovered at once

Explanation

The TSDB writes samples into in-memory chunks and periodically flushes them into immutable blocks on disk, each spanning a time range and containing index and chunk files. Compaction merges smaller blocks into larger ones.

Question 22Observability Concepts

A histogram metric has buckets ending at 0.1, 0.5, and 1.0. If the 0.5 bucket has a cumulative count of 80 and the 0.1 bucket has 30, how many observations fell between 0.1 and 0.5 seconds?

  1. 80
  2. 50 Correct answer.
  3. 30
  4. 110

Explanation

Histogram bucket counters are cumulative, so the count for a bucket includes all smaller buckets. Subtracting the 0.1 bucket's 30 from the 0.5 bucket's 80 gives 50 observations in the (0.1, 0.5] interval.

Question 23Observability Concepts

Two series, a and b, are matched with the expression a / ignoring(code) b. What does ignoring(code) change about the match?

  1. It matches on all labels except code, so differing code values no longer prevent a match Correct answer.
  2. It drops the code label from the output series
  3. It renames the code label to ignored
  4. It matches only on the code label

Explanation

By default, binary operators match on all labels except the metric name. The ignoring modifier excludes the listed labels from matching, so series that differ only in code are paired.

Question 24Observability Concepts

An alerting rule uses increase(job_failures_total[1h]) > 0 with a for of 10m and an evaluation interval of 1m. What does the pending state represent?

  1. The expression has never been true during the window
  2. The alert has fired and notifications are being routed
  3. The expression is true but has not yet been true for the full 10 minutes Correct answer.
  4. The alert was silenced by an operator

Explanation

When the rule expression first becomes true, the alert enters the pending state and starts a timer. Only after the for duration elapses continuously does it transition to firing and get sent to Alertmanager.

Question 25Observability Concepts

A PromQL query uses the @ modifier, for example http_requests_total @ 1609746000. What does it do?

  1. It evaluates the selector at a fixed Unix timestamp regardless of the query step Correct answer.
  2. It rounds the result to the nearest timestamp
  3. It restricts the query to samples newer than that timestamp
  4. It sets the scrape timestamp for future samples

Explanation

The @ modifier pins evaluation of a selector to a specific Unix timestamp, which is useful for comparing current values against a fixed point in time. It can also be combined with start() and end() for range query boundaries.

Question 26Observability Concepts

Which Prometheus metric type is the only one whose value must never decrease while the process is running, making it suitable for counting completed events?

  1. Gauge
  2. Histogram
  3. Counter Correct answer.
  4. Summary

Explanation

A counter is monotonic: it only goes up, or resets to zero when the process restarts, and PromQL's rate and increase functions are designed around that property. Gauges can move in either direction, while histograms and summaries are composite types that expose bucket or quantile series rather than a single monotonic tally.

Question 27Observability Concepts

A developer wants Prometheus to attach the label env="prod" to every series scraped from one particular job, without editing the application code. Which configuration accomplishes this?

  1. Add a recording rule that appends env="prod" to each series
  2. Add env: prod to the alertmanager configuration
  3. Add a static_configs entry with labels: {env: prod} under the scrape_config for that job Correct answer.
  4. Add env: prod under global: in the configuration file

Explanation

Labels declared inside a static_configs block are attached to every target in that block and are then applied to all samples scraped from those targets, so the application needs no change. The global section holds defaults such as scrape_interval and external_labels, not per-target labels.

Question 28Observability Concepts

Which statement best describes the role of exemplars in the Prometheus ecosystem?

  1. They define the retention period for each tenant in a multi-tenant setup
  2. They compress old time series blocks to reduce disk usage
  3. They replace alerting rules when the Alertmanager is not deployed
  4. They attach a sampled trace identifier to a histogram observation so a metric can be linked to a specific request trace Correct answer.

Explanation

An exemplar is an optional reference, typically a trace ID plus timestamp, stored alongside a histogram bucket observation. This lets an operator jump from an aggregated latency spike in a metric to a concrete distributed trace for investigation.

Question 29Observability Concepts

An operator wants alert notifications to carry the runbook URL and severity defined once, rather than duplicating them in every rule file. Which mechanism is intended for this?

  1. Define them as labels on the alerting rule and reference them in the Alertmanager template Correct answer.
  2. Put them in the scrape_config as target labels
  3. Encode them in the metric name of the alerting expression
  4. Store them in the for clause of the rule

Explanation

Labels placed on an alerting rule are propagated into the alert instances and are available to Alertmanager notification templates, so shared metadata can be defined once per rule or group. Templates then render those labels into the notification body or annotations.

Question 30Observability Concepts

A team instruments a request-duration histogram and wants to know how many requests took longer than 2 seconds. Given the cumulative bucket series, which expression gives that count for the last 10 minutes?

  1. increase(http_request_duration_seconds_count[10m]) - increase(http_request_duration_seconds_bucket{le="2"}[10m]) Correct answer.
  2. histogram_quantile(0.95, http_request_duration_seconds_bucket)
  3. rate(http_request_duration_seconds_sum[10m])
  4. increase(http_request_duration_seconds_bucket{le="2"}[10m]) / increase(http_request_duration_seconds_count[10m])

Explanation

Because histogram buckets are cumulative, the _count series equals the +Inf bucket, so subtracting the le="2" bucket from the total leaves the observations above 2 seconds. Applying increase over the same range keeps the two sides comparable.

Question 31Observability Concepts

What is the difference between the rate() and irate() functions when applied to a counter over a range vector?

  1. rate() requires a range of at least one hour, while irate() accepts any range
  2. rate() works only on gauges, while irate() works only on counters
  3. irate() returns a total increase, while rate() returns a per-second value
  4. rate() averages the per-second increase across the whole range, while irate() uses only the last two samples Correct answer.

Explanation

rate() divides the total increase over the range by the range duration, smoothing out spikes. irate() computes the instantaneous per-second change from the final two samples in the range, which reacts faster but is noisier and can miss short-lived events.

Question 32Observability Concepts

A scrape target exposes a metric whose label value includes a raw user ID, producing hundreds of thousands of distinct series. What is the most direct consequence for Prometheus?

  1. The Alertmanager rejects alerts that reference that metric
  2. The scrape interval automatically increases to compensate
  3. Memory and index size grow with each distinct series, risking an out-of-memory condition or slow queries Correct answer.
  4. The counter resets to zero whenever a new label value appears

Explanation

Every unique combination of metric name and label values is a separate time series held in the head block and the index, so unbounded label values drive up memory and storage and degrade query performance. This is the classic high-cardinality problem, and the usual remedy is to drop or aggregate the offending label.

Question 33Observability Concepts

An operator writes up{job="api"} == 0 to detect an instance that is reachable but reports zero healthy upstreams. What does the == operator do when both sides are instant vectors?

  1. It always returns 0 or 1 for each matching series
  2. It compares only the metric names and ignores the sample values
  3. It returns every series from both sides and marks matches with a boolean label
  4. It returns the left-hand series whose value equals the right-hand series value, filtered by matching labels Correct answer.

Explanation

Between two instant vectors, comparison operators act as filters: a series from the left side is kept only when the comparison with its label-matched counterpart on the right holds, and the left sample value is returned. Adding bool would instead return 0 or 1 for each match.

Question 34Observability Concepts

A team wants dashboards to show a service-level indicator computed from a ratio of two counters, refreshed on every evaluation. Which approach fits Prometheus best?

  1. Export the ratio directly from the application as a gauge
  2. Create a recording rule that stores the ratio as a new series, then graph that series Correct answer.
  3. Compute the ratio in the dashboard backend on every page load
  4. Store the ratio in the Alertmanager as an annotation

Explanation

Recording rules evaluate a PromQL expression on a schedule and persist the result as a new series, which is the idiomatic way to precompute expensive or frequently reused ratios. Dashboards then query the recorded series cheaply and consistently.

Question 35Observability Concepts

A metric endpoint returns 200 responses but the body is not valid Prometheus exposition text, so the scrape fails to parse. How does Prometheus treat this target in the up metric?

  1. up is 0.5 to signal a partial success
  2. up is 0 for that target, and the scrape error is recorded, even though the HTTP request succeeded Correct answer.
  3. up is absent entirely until the target is removed from service discovery
  4. up is 1 because the HTTP status code was 200

Explanation

up reports whether the scrape as a whole succeeded, meaning the HTTP fetch and the parsing of the exposition format both completed. A syntactically invalid payload therefore yields up 0, and the failure is visible in scrape health metrics and logs.

Question 36Observability Concepts

An engineer needs to compare this week's request rate with the same window one week earlier inside a single expression. Which construct produces that comparison correctly?

  1. rate(http_requests_total[5m]) / rate(http_requests_total[5m]) offset 1w
  2. rate(http_requests_total[5m] offset 1w) / rate(http_requests_total[5m] offset 2w)
  3. rate(http_requests_total[5m] offset 1w) / rate(http_requests_total[5m]) offset 1w
  4. rate(http_requests_total[5m]) / rate(http_requests_total[5m] offset 1w) Correct answer.

Explanation

The offset modifier must be attached to the selector inside the range, so rate(http_requests_total[5m] offset 1w) evaluates the same five-minute window shifted back one week. Dividing the current rate by that shifted rate yields a week-over-week ratio in one expression.

Question 37Prometheus Fundamentals

In Prometheus, which component is responsible for scraping metric endpoints and storing the resulting samples locally?

  1. The Prometheus server Correct answer.
  2. The Pushgateway
  3. The node_exporter
  4. The Alertmanager

Explanation

The Prometheus server runs the retrieval loop that pulls metrics over HTTP and writes samples into its local time series database. Alertmanager only routes alerts, the Pushgateway accepts pushed metrics, and exporters merely expose metrics for scraping.

Question 38Prometheus Fundamentals

What does a single Prometheus sample consist of?

  1. A metric name, a set of label pairs, a timestamp, and a float value Correct answer.
  2. A trace span identifier and a duration
  3. A JSON document and an HTTP status code
  4. A metric name and a log line

Explanation

Prometheus stores each sample as a float64 value with a millisecond timestamp, associated with a series identified by the metric name plus its label set. Log lines, spans, and arbitrary JSON documents are not the storage unit of the TSDB.

Question 39Prometheus Fundamentals

Which metric type is appropriate for a value that only increases, such as the total number of HTTP requests served?

  1. Histogram
  2. Counter Correct answer.
  3. Summary
  4. Gauge

Explanation

A counter is a cumulative metric that only increases (or resets to zero on restart), which matches a monotonically growing request total. Gauges can go up and down, while histograms and summaries are for distributions of observations.

Question 40Prometheus Fundamentals

What is the purpose of the `up` metric that Prometheus generates automatically for each scrape target?

  1. It reports the number of active scrapes per second
  2. It reports the version of the exporter
  3. It reports 1 if the last scrape succeeded and 0 if it failed Correct answer.
  4. It reports the uptime of the Prometheus server in seconds

Explanation

For every configured target, Prometheus synthesizes an `up` series whose value is 1 when the most recent scrape succeeded and 0 when it failed. This makes target availability directly queryable without any exporter cooperation.

Question 41Prometheus Fundamentals

What is the default HTTP path that Prometheus requests when scraping a target if none is specified?

  1. /api/v1/metrics
  2. /stats
  3. /metrics Correct answer.
  4. /prometheus

Explanation

Unless the `metrics_path` field overrides it, Prometheus scrapes the `/metrics` endpoint on the target. This convention is followed by official exporters and client libraries.

Question 42Prometheus Fundamentals

Which label name is reserved and cannot be used as an ordinary metric label because Prometheus attaches it automatically?

  1. __name__ Correct answer.
  2. metric_group
  3. series_id
  4. instance_type

Explanation

The label `__name__` holds the metric name internally, so a user-defined label may not use it. Other double-underscore labels are also reserved for internal use and are removed after relabeling.

Question 43Prometheus Fundamentals

Why does Prometheus discourage using labels with high-cardinality values such as user IDs or email addresses?

  1. High-cardinality labels disable the query engine
  2. Each distinct label combination creates a new time series, which increases memory and index size Correct answer.
  3. Labels containing digits are rejected by the parser
  4. Labels with long values are truncated at scrape time

Explanation

A time series is uniquely identified by its metric name and full label set, so every new label value multiplies the number of stored series. Unbounded values like user IDs can exhaust memory and slow queries dramatically.

Question 44Prometheus Fundamentals

What does the PromQL expression `rate(http_requests_total[5m])` compute?

  1. The number of distinct request paths in the last five minutes
  2. The per-second average rate of increase over the last five minutes Correct answer.
  3. The total number of requests in the last five minutes
  4. The maximum request rate observed in the last five minutes

Explanation

`rate` takes a range vector and returns the per-second average rate of increase, extrapolated to the range boundaries. It also handles counter resets correctly, unlike a raw subtraction.

Question 45Prometheus Fundamentals

A metric is defined as `request_duration_seconds` and emitted with labels `method` and `status`. How many time series exist if there are 3 methods and 4 status codes, assuming all combinations occur?

  1. 7
  2. 4
  3. 12 Correct answer.
  4. 3

Explanation

Each unique combination of label values forms a separate series, so 3 methods multiplied by 4 status codes yields 12 series. The metric name is shared across all of them.

Question 46Prometheus Fundamentals

What is the difference between a histogram and a summary in Prometheus?

  1. Summaries can be aggregated across instances, while histograms cannot
  2. Histograms store raw samples, while summaries store only averages
  3. Histograms expose bucket counters that can be aggregated across instances, while summaries expose precomputed quantiles that cannot be aggregated Correct answer.
  4. Histograms only work with counters, while summaries only work with gauges

Explanation

A histogram publishes cumulative bucket counters plus `_count` and `_sum`, so quantiles can be computed server-side and buckets summed across instances. A summary computes quantiles client-side per instance, and those quantiles cannot be meaningfully combined.

Question 47Prometheus Fundamentals

Which configuration block in `prometheus.yml` defines a set of targets and the scrape interval used for them?

  1. rule_files
  2. scrape_configs Correct answer.
  3. storage
  4. alerting

Explanation

`scrape_configs` is the top-level list of scrape job definitions, each containing targets, `metrics_path`, and timing settings such as `scrape_interval`. The other top-level keys configure alerting, rule loading, and storage respectively.

Question 48Prometheus Fundamentals

What is the effect of setting `honor_labels: true` in a scrape configuration?

  1. All labels from the target are discarded
  2. The target's labels are merged only if they match the job label
  3. Conflicting labels from the target are kept and the scraped labels are renamed with an exported_ prefix Correct answer.
  4. The scrape fails if any label collides with a server label

Explanation

By default, server-side labels such as `job` and `instance` win conflicts. With `honor_labels: true`, the scraped labels are preserved and conflicting server labels are renamed with an `exported_` prefix.

Question 49Prometheus Fundamentals

What does the `for` field in an alerting rule control?

  1. The maximum number of times an alert is sent
  2. How long the alert expression must remain true before the alert starts firing Correct answer.
  3. The interval at which the alert is re-evaluated
  4. The time window used by the rate function

Explanation

`for` introduces a pending period: the alert must be continuously active for that duration before transitioning to firing. This suppresses alerts caused by brief spikes.

Question 50Prometheus Fundamentals

Which PromQL function should be used to count how many requests were added over the last hour, given a counter?

  1. increase(http_requests_total[1h]) Correct answer.
  2. sum_over_time(http_requests_total[1h])
  3. changes(http_requests_total[1h])
  4. delta(http_requests_total[1h])

Explanation

`increase` returns the total increase of a counter over the range, extrapolated to the boundaries, and it accounts for counter resets. `delta` is intended for gauges and does not handle resets.