Mixed Deck — All PCA Topics Flashcards
100 cards from real PCA practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 20 Mixed Deck — All PCA Topics flashcards as text
Which TSDB concept represents a contiguous on-disk directory containing immutable compressed samples for a fixed time range?
Answer: Block
A TSDB block is a directory (e.g., 01BX…) holding an index, chunks, and metadata for a specific time range, produced by compaction from the WAL.
Which relabeling action renames all labels matching a regex by applying a replacement pattern to their names?
Answer: labelmap
`labelmap` applies the regex to all label *names* and renames matching labels according to the replacement pattern, useful for promoting meta-labels.
In a recording rule, what does the `labels` field allow you to do?
Answer: Add or overwrite labels on the resulting recorded metric
The labels field in a recording rule attaches additional static labels to all series written by that rule.
What does the `group_left` modifier do in a PromQL join, commonly used in recording rules?
Answer: It performs a many-to-one join, carrying labels from the right-hand side onto many left-hand series
group_left allows a many-to-one vector matching where multiple left-side series match one right-side series, copying right-side labels onto the result.
In a Prometheus scrape_config, what does `scheme: https` combined with an empty `tls_config` result in by default?
Answer: TLS is used but the target certificate is verified against system CAs
Without explicit `ca_file` or `insecure_skip_verify`, Prometheus validates the target's certificate against the host system's default CA bundle.
What does the `__address__` label represent in Prometheus target discovery?
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.
What does the binary operator `unless` do in PromQL?
Answer: Returns elements from the left-hand side that have NO matching elements on the right-hand side
`unless` returns all elements of the left-hand vector for which there are no matching elements in the right-hand vector.
What are histograms used for in Prometheus?
Answer: To monitor distribution of values like durations
Prometheus typically uses a pull model, but short-lived jobs (like batch scripts or cron jobs) may not exist long enough for Prometheus to scrape them directly. The Pushgateway acts as an intermediary, allowing these ephemeral jobs to push their metrics to it. Prometheus then scrapes the Pushgateway, ensuring that metrics from short-lived processes are collected and stored for monitoring.
What is PromQL?
Answer: A configuration language
Prometheus handles multi-dimensional data by associating key-value pairs, known as labels, with each metric. These labels allow the same metric to be broken down and filtered across various dimensions, such as instance, service, endpoint, or environment. This enables powerful aggregation and analysis, providing granular insights into different aspects of a system's behavior.
What does `absent(up{job="myapp"})` return when the time series EXISTS?
Answer: An empty vector (no data)
`absent()` returns an empty vector when the input time series exists, and returns a vector with value 1 only when the series is missing.
What flag must be passed to a Prometheus server to allow it to accept remote_write data from other Prometheus instances?
Answer: --web.enable-remote-write-receiver
The --web.enable-remote-write-receiver flag activates the /api/v1/write endpoint so that Prometheus can act as a remote_write target for other Prometheus servers.
Which flag must be explicitly enabled to allow the Prometheus admin HTTP API (e.g., snapshot, delete_series) to function?
Answer: --web.enable-admin-api
Admin API endpoints are disabled by default and require the --web.enable-admin-api flag to be set when starting Prometheus.
What does the `topk(3, http_requests_total)` expression return?
Answer: The 3 time series with the highest values at the current moment
`topk(k, expr)` returns the k time series with the largest values at the current evaluation timestamp.
How can Prometheus alerting rules be defined?
Answer: By defining conditions in PromQL
Prometheus alerting works by continuously evaluating predefined alerting rules, which are PromQL expressions. When a rule's condition evaluates to true (e.g., a metric value crosses a specified threshold for a certain duration), Prometheus generates an alert. This alert is then sent to the Alertmanager, which handles deduplication, grouping, and routing notifications to users via various channels.
What does the `rate()` function calculate when applied to a counter metric?
Answer: The per-second average rate of increase over the range window
`rate()` calculates the per-second average rate of increase of a counter over the specified time range window.
Which open-source project extends Prometheus with global query capability and long-term object storage integration?
Answer: Thanos
Thanos adds a sidecar to Prometheus that uploads blocks to object storage (e.g., S3, GCS) and provides a global query layer across multiple Prometheus instances.
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?
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.
What is the role of the Prometheus Alertmanager?
Answer: To manage alerts and send notifications
The Prometheus Alertmanager manages alerts, including grouping, silencing, and sending notifications to users or external systems.
What is the recommended way to add TLS encryption to Prometheus scrape endpoints?
Answer: Configure tls_config in the scrape job or use a reverse proxy with TLS termination
Prometheus supports tls_config in scrape_configs to present or verify TLS certificates, or you can terminate TLS at a reverse proxy.
What Prometheus label controls which Alertmanager instance a particular alert is routed to?
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.