What is the default value for the scrape interval?
The global default scrape interval is 1 minute.
Why this answer
The default scrape interval in Prometheus is 1 minute.
304 questions total · 5pages · All types, answers revealed
What is the default value for the scrape interval?
The global default scrape interval is 1 minute.
Why this answer
The default scrape interval in Prometheus is 1 minute.
You need to monitor the availability of a specific web endpoint from external locations using blackbox_exporter. What is the primary purpose of the 'module' configuration in blackbox_exporter?
Modules encapsulate configuration settings like timeouts and HTTP matchers for specific probes.
Which TWO of the following are valid components of an Alertmanager configuration file?
Receivers define where alerts are sent.
Why this answer
A standard Alertmanager config file requires 'route' (the routing tree) and 'receivers' (the notification targets).
Which TWO are true about the 'Summary' metric type?
This is their key feature.
Why this answer
Summaries are pre-calculated at the client side and provide quantiles.
Which TWO of the following are core responsibilities of the Prometheus server?
The server processes recording and alerting rules.
Why this answer
Prometheus primarily scrapes metrics and evaluates rules.
Which TWO of these are true about the 'Pull' model?
That is the definition of pull.
Why this answer
Prometheus controls the scrape and can detect target downtime.
Which THREE aggregation operators in PromQL support the 'by' and 'without' clause modifiers? (Choose three)
sum supports grouping via 'by' and 'without'.
Why this answer
Most PromQL aggregators support grouping clauses. Examples include sum, avg, min, max, count, stddev, stdvar, bottomk, topk, quantile.
What is the purpose of the 'instance' label in Prometheus?
It uniquely identifies the source of the scrape.
Why this answer
It is an automatically added label that identifies the target (host:port) that the metric was scraped from.
Which PromQL function is specifically designed to calculate the per-second average rate of increase of a time series over a given range vector?
rate() calculates the per-second average rate of increase of counter time series.
Why this answer
The rate() function is designed for counters to calculate the per-second average rate of increase, handling counter resets automatically.
Where do you define the scrape interval for a specific target?
scrape_configs allows per-job interval configuration.
Why this answer
The scrape_interval can be defined within the scrape_config for that specific job.
Which THREE items are standard techniques to reduce metric cardinality?
Reduces the number of individual series.
Why this answer
Dropping labels, aggregating metrics, and limiting metric frequency are standard ways to reduce cardinality.
When using 'irate', what is the impact of choosing a range vector that is too small (e.g., [10s])?
irate is sensitive to small fluctuations between the two most recent points.
Why this answer
irate only looks at the last two data points in the range; if the range is too small, it might miss changes.
You need to measure the P99 latency of your service. Which PromQL function do you use on a Histogram?
This is the correct function for quantiles.
Why this answer
The 'histogram_quantile' function is required to calculate quantiles from bucketed histogram data.
Which TSDB component is responsible for ensuring data durability if the server crashes?
The WAL ensures that data in memory can be recovered after a crash.
Why this answer
The Write-Ahead Log (WAL) records incoming samples before they are committed to blocks.
When evaluating a rule with offset, such as http_requests_total offset 1h, what exact time does Prometheus query?
Correct. offset shifts the evaluation window into the past.
Why this answer
The offset modifier shifts the evaluation time backward by the specified duration relative to the evaluation timestamp.
You have a Prometheus alerting rule that triggers too frequently during flapping states. Which feature should you use to prevent this without silencing the alert entirely?
Setting a 'for' duration ensures the condition must persist before the alert fires.
Why this answer
The 'for' field in an alerting rule allows you to specify a duration before the alert transitions from 'pending' to 'firing', which filters out short-lived spikes.
Which TWO of the following are valid ways to modify or add labels to time series in PromQL? (Choose two)
label_replace allows matching and replacing regex patterns in label values.
Why this answer
PromQL provides label_replace and label_join to modify and construct labels dynamically.
You want to find the maximum value of a gauge metric across all instances over a 1-hour sliding window. Which function accomplishes this?
Correct. max_over_time finds the maximum value across the range vector.
Why this answer
The max_over_time() function evaluates the maximum value of all data points in a specified range vector for each time series.
Which TWO of the following are examples of metric data?
Gauge metric.
Why this answer
CPU percentage and total request count are classic metrics.
Which component is responsible for executing queries written in PromQL?
Prometheus parses and executes the query.
Why this answer
The Prometheus server itself contains the query engine that processes PromQL expressions.
Which TWO of these are potential side effects of high-cardinality metrics?
Each series takes memory.
Why this answer
Memory exhaustion (OOM) and slow query performance are the direct results of high cardinality.
An administrator wants to aggregate CPU usage across all nodes, keeping the instance label while summing the values. Which aggregation clause should be used?
Correct. The 'by' clause keeps the specified list of labels and drops all others.
Why this answer
The by clause specifies the labels that should be preserved in the aggregated result vector.
You want to find the top 3 jobs with the highest CPU usage using the metric 'process_cpu_seconds_total'. Which PromQL query structure is correct?
topk correctly takes k=3 and an instant vector derived from rate().
Why this answer
The topk() function takes an integer 'k' and an instant vector (typically wrapped in rate()), returning the top k time series with the highest values.
When evaluating a histogram metric, what does the special pseudo-label le represent in bucket time series?
Correct. 'le' stands for less than or equal to, defining bucket boundaries.
Why this answer
The le (less than or equal to) label represents the upper bound of a histogram bucket.
Which aggregation operator would you use to calculate the total sum of a metric across all instances?
sum() aggregates values across all series.
Why this answer
sum() is the standard operator for calculating totals across dimensions.
What is the purpose of the 'offset' modifier in a PromQL query?
Offset shifts the time window for the instant or range vector.
Why this answer
The 'offset' modifier allows querying data from the past relative to the current time.
Which PromQL aggregator should be used to count the total number of active time series matching a selector?
Correct. count returns the number of series in the vector.
Why this answer
The count operator counts the number of time series in an instant vector.
What is the difference between a Histogram and a Summary?
Histograms aggregate counts into predefined buckets.
Why this answer
Histograms provide aggregated quantiles on the server side via buckets, while Summaries calculate quantiles on the client side.
You have a recording rule that fails to evaluate because of a 'labels conflict'. What is the most likely cause?
Prometheus requires unique labels for each time series; conflicts occur if the result isn't unique.
Why this answer
A label conflict occurs when the recording rule tries to create a metric with labels that are already present or restricted, or when the aggregation produces duplicate label sets.
When setting up Alertmanager, what happens if you have no route defined for an alert?
The root route acts as the default catch-all.
Why this answer
If an alert matches no specific route, it will fall back to the root route of the configuration tree.
When calculating the 95th percentile from a histogram, why is histogram_quantile(0.95, sum(rate(http_duration_seconds_bucket[5m])) by (le)) the recommended pattern?
Summing by the 'le' label merges distributions while preserving the necessary bucket structure.
Why this answer
Aggregation must occur before the quantile calculation to ensure all buckets are summed across labels.
What is the purpose of the 'le' label in a Histogram?
It represents the bucket threshold.
Why this answer
The 'le' label stands for 'less than or equal to' and defines the upper bound of the histogram bucket.
Which THREE of the following are valid Alertmanager grouping parameters?
Defines the labels to group by.
Why this answer
Alertmanager grouping is configured via 'group_by', 'group_wait', and 'group_interval'.
Which TWO of the following are necessary to successfully inhibit an alert in Alertmanager?
Defines the alert to be suppressed.
Why this answer
Inhibition requires a 'target_matchers' (the alert to be silenced) and 'source_matchers' (the alert that triggers the silence), plus common labels to correlate the two.
When writing a PromQL query involving a vector and a scalar, such as 'node_memory_free_bytes / (1024 * 1024)', how does Prometheus handle label matching?
A scalar operation applies to every time series in the instant vector without altering or matching labels.
Why this answer
Operations between an instant vector and a scalar are performed on each data point of the vector. Labels are unaffected.
Which operator performs a set union in PromQL?
or returns the union.
Why this answer
The 'or' operator returns the union of two vectors.
Which TWO of the following are true regarding instant vectors?
By definition, instant vectors are a single point in time.
Why this answer
Instant vectors contain a single sample per time series, typically the most recent.
Which TWO of the following conditions will cause the rate() function to return NaN or empty results? (Choose TWO)
Correct. Zero samples in the range window result in no output.
Why this answer
rate() requires range vectors with sufficient data points and valid counter metrics. Stale series or ranges with zero samples yield empty or NaN results.
What happens if a label set for a metric changes during its lifetime?
Prometheus treats different label sets as entirely different series.
Why this answer
Changing a label set creates a brand new time series in Prometheus.
An application is emitting logs that contain '5xx' status codes when a service is unavailable. If you want to create an alert that triggers based on the rate of these errors, what is the best practice for observability?
Converting log events to metrics provides a reliable, performant signal for alerting.
Why this answer
Logs are useful for root cause analysis, but for alerting on rates, you should convert the error occurrence into a metric increment, as metrics are more efficient for long-term calculation and alerting.
You need to calculate the per-second rate of increase for a counter metric over the last 10 minutes. Which function is most appropriate?
rate() divides the total increase by the number of seconds in the range.
Why this answer
rate() is the standard function for calculating the per-second rate of increase over a range vector.
When integrating Grafana with Prometheus, what is the standard authentication method if Prometheus is behind a reverse proxy?
Basic Auth is the built-in, recommended standard for securing the data source connection.
Why this answer
Grafana supports various authentication methods; using a Basic Auth header or a proxy header is the standard way to securely connect to a protected Prometheus instance.
Why are 'logs' essential for debugging, even with perfect metrics?
Logs allow drill-down into specific failures.
Why this answer
Logs provide the granular, detailed context (like specific error messages or stack traces) that metrics cannot provide.
A developer asks why they should use Distributed Traces instead of simply using high-cardinality metrics to debug a slow request. What is the primary advantage of traces?
Traces follow the lifecycle of a request, revealing exactly where bottlenecks exist in complex architectures.
Why this answer
Distributed traces provide the full execution path and context of a single request across multiple services, which metrics cannot do.
You are performing a 'label_replace' operation. What is the correct syntax for a regex capture group?
Prometheus uses $1 for the first captured group in replacement strings.
Why this answer
Prometheus uses standard RE2 regex syntax, where capture groups are accessed via $1, $2, etc.
You are implementing a custom exporter for a legacy database. The database provides a single value representing the number of active connections. Which metric type should you use to best represent this data?
Gauges are designed for values that can fluctuate arbitrarily, such as active connections.
Why this answer
Because active connections fluctuate up and down as users connect and disconnect, a Gauge is the appropriate metric type for representing a snapshot of the current state.
Which THREE factors contribute to a 'high cardinality' problem in a Prometheus environment?
These values are unique per user, leading to massive series growth.
Why this answer
High cardinality is caused by labels with many unique values, like timestamps, user IDs, or un-normalized request paths.
Which THREE of the following are standard ways to send notifications from Alertmanager?
Standard programmatic integration.
Why this answer
Webhook, Email, and PagerDuty are built-in, widely used receiver types.
You are troubleshooting high cardinality in your metrics. What is a common cause for this in a custom exporter?
Including unique identifiers as labels creates a new time series for every single value, leading to cardinality explosion.
Why this answer
High cardinality occurs when a label value has an unbounded number of unique values (like a request ID or a timestamp), causing a massive explosion in the number of unique time series.
In the context of the Four Golden Signals, what does 'Saturation' measure?
Queued work indicates resource contention.
Why this answer
Saturation measures how 'full' a service is, typically defined by identifying the most constrained resource (e.g., CPU, RAM, or disk IO).
Which of these is NOT a valid Alertmanager receiver type?
SQL is not a native alerting receiver.
Why this answer
While Alertmanager supports many integrations (Webhook, Email, PagerDuty), 'SQL' is not a native built-in receiver type.
What is the purpose of the 'labels' field in an alerting rule?
Labels are the primary mechanism for routing and grouping in Alertmanager.
Why this answer
Labels allow you to attach metadata to the alert, which can then be used in Alertmanager for routing and grouping.
Which THREE of the following are valid ways to modify a binary operation join?
group_right is a valid join modifier.
Why this answer
on, ignoring, group_left, and group_right are the valid modifiers for binary joins.
Which configuration parameter limits the number of series in the head block?
This flag limits the active series in memory.
Why this answer
The 'storage.tsdb.head-series-limit' flag helps prevent OOM by capping series count.
In the Prometheus data model, what is a 'sample'?
A sample consists of a float64 value and a millisecond-precision timestamp.
Why this answer
A sample is a value-timestamp pair associated with a specific series.
You notice that your Prometheus instance memory usage is growing linearly despite constant traffic. What is the most likely cause?
High label variance causes memory inflation.
Why this answer
If cardinality (unique label combinations) increases over time, the number of active time series keeps growing, increasing RAM usage.
Which TWO statements accurately describe the differences between logs and metrics?
Metrics are highly efficient for time-series aggregation.
Why this answer
Metrics are numerical aggregations (efficient), whereas logs are event-based records (detailed).
Which selector syntax correctly matches all time series where the environment label does NOT equal production?
Correct. The != operator matches time series where the label does not match the given string.
Why this answer
The != operator is the standard negative equality matcher in PromQL label selectors.
What is the default retention period for Prometheus data?
15 days is the default storage retention.
Why this answer
The default retention for local Prometheus storage is 15 days.
Which THREE of the following functions are specifically designed to be used with range vectors? (Choose THREE)
Correct. delta() takes a range vector.
Why this answer
Functions like rate(), increase(), and delta() require range vectors as arguments, whereas sum() and max() operate on instant vectors.
What is the primary function of the 'blackbox_exporter' in a monitoring architecture?
It monitors services from an external perspective.
Why this answer
It allows monitoring of endpoints from the outside (blackbox perspective) rather than the inside (whitebox instrumentation).
Which TWO of the following are valid metric types natively supported by Prometheus? (Choose TWO)
Correct. Gauge represents a single numerical value that can go up and down.
Why this answer
Prometheus natively supports four core metric types: Counter, Gauge, Histogram, and Summary.
Which TWO of the following are true about the Pushgateway?
Stale metrics persist until deleted.
Why this answer
Pushgateway is for batch jobs and requires manual deletion of metrics.
Which TWO are common causes of high-cardinality in Kubernetes environments?
These are infinite in number.
Why this answer
Using pod names or unique request IDs as labels creates high cardinality.
Which THREE of the following are valid metric types supported natively by Prometheus client libraries?
Histogram is a valid native metric type.
Why this answer
The four core metric types in Prometheus are Counter, Gauge, Histogram, and Summary.
When using a Prometheus client library to instrument a Go application, which function call is typically used to register a new metric?
MustRegister is the standard way to register collectors with the default registry.
Why this answer
In client_golang, metrics are registered with a Registry object (often the DefaultRegistry) via the MustRegister or Register function.
How does PromQL handle operator precedence between arithmetic operators like multiplication (*) and addition (+)?
Correct. Multiplication evaluates before addition.
Why this answer
PromQL follows standard mathematical order of operations, where multiplication and division take precedence over addition and subtraction.
What is 'Monitoring Philosophy' regarding alerts?
Alerting on user-facing symptoms is best practice.
Why this answer
Effective alerting should be actionable, low-noise, and focus on symptoms (what the user sees) rather than causes.
When using the 'scrape_timeout', what happens if the timeout is reached?
A timeout results in a failed scrape event.
Why this answer
If the timeout is reached, the scrape is aborted, and a 'up{job=...} == 0' metric is recorded.
When using 'remote_write', how does Prometheus ensure data delivery?
Remote write implements retries to handle temporary network issues.
Why this answer
Prometheus uses an internal queue and retry logic to ensure delivery to remote endpoints.
Which function is used to convert a counter rate into a per-second rate over a time range?
rate() provides the per-second increase of a counter.
Why this answer
rate() is the standard function for per-second rates of counters.
Which THREE of the following are common issues that cause scraping failures?
Correct.
Why this answer
Common issues include network connectivity, incorrect scrape configurations, and exporter timeouts.
Which THREE of the following are valid components within a Prometheus Alerting Rule file?
The PromQL expression used to evaluate the condition.
Why this answer
Prometheus alerting rules contain a 'groups' array, which contains individual 'rules' (alerts or recordings), and each alert rule must have an 'alert' name and 'expr'.
What is the recommended approach for metrics that only need to be exposed periodically?
Consistency is key to prevent gaps in time series data.
Why this answer
If metrics are not always available, they should still be exposed (perhaps with a null or default value) to ensure consistent scraping.
Which THREE of the following are valid aggregation operators in PromQL? (Choose THREE)
Correct. stddev is a valid aggregator.
Why this answer
PromQL provides numerous aggregation operators including sum, min, max, avg, stddev, stdvar, count, count_values, bottomk, topk, and quantile.
Practice PCA by domain
Target a specific domain to shore up weak areas.