Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

System Design blueprint · Cloud infrastructure

Metrics, logs & alerting platform

Collects metrics and logs from every service, stores them in tiered time-series and log stores, and turns alert rules into deduplicated pages for the right on-call engineer. It must never silently drop the data or alerts that tell you production is broken, even when the platform itself is under load.

Steps
9
Subjective questions
33
Objective questions
33

The problem and the outcome

Problem: Teams running hundreds of services cannot see failures across scattered hosts and pods, and naive alerting either misses incidents or floods on-call with duplicate pages. Storage costs grow quickly when every label and log line is kept at full resolution forever.

Outcome: Engineers get one place to query metrics and logs, alerts arrive once per incident at the correct rotation, and old data moves automatically to cheaper downsampled or cold tiers. Cardinality limits keep one bad deployment from taking the platform down.

Architecture

App hostsservices & podsCollector agentsOTel / Fluent Bit01Ingest queueKafka topics02Metrics ingestercardinality limits03Time-series DBraw + downsampled04Log pipelineparse & redact05Log storelabel index+chunksObject storagewarm & cold tiers06Rule evaluatoralert expressions07Alertmanagerdedup, group, route08Paging toolon-call schedulesOn-call engineeracks & triagesDashboardsGrafana queries09scrape + tail logsbatched, compressedmetrics topiclogs topicwrite samplesindex labels onlycompact + downsampleage out to coldevaluate every 1mlog-based rulesfiring / resolvedone page per grouppage + escalateinvestigaterange querieslog searchdisk buffer on outage

How it works, step by step

  1. Agents on each node scrape Prometheus endpoints and tail container logs, attach resource labels (cluster, namespace, service), and buffer to local disk if the pipeline is unreachable.
  2. Agents publish batched, compressed payloads to separate Kafka topics for metrics and logs, partitioned by tenant and series hash so a spike is absorbed by the queue instead of the stores.
  3. Metrics ingesters consume from Kafka, enforce per-tenant limits on active series and label values, drop or reject offending series with a visible counter, and replicate writes.
  4. The time-series database keeps recent raw samples in memory and on local disk, then compactors build blocks in object storage and produce downsampled rollups (for example 5-minute and 1-hour) for long-range queries.
  5. The log pipeline parses structured fields, redacts secrets and personal data, and writes compressed chunks with a small label index rather than full-text indexing every field.
  6. Retention tiers apply per tenant: hot raw data on fast storage, older data as compacted or downsampled blocks in object storage, and expiry after the agreed retention window.
  7. The rule evaluator runs recording rules and alert rules on a fixed interval, using 'for' durations to ignore brief blips and preferring SLO burn-rate alerts over raw thresholds.
  8. Alertmanager groups related alerts, deduplicates notifications from replicated rulers, applies silences and inhibitions, and routes by labels like team and severity to the right paging schedule.
  9. The paged engineer acknowledges, opens the linked dashboard and correlated logs in Grafana, and the alert auto-resolves when the condition clears.

Tech stack

  • OpenTelemetry Collector and Fluent Bit agents
  • Apache Kafka
  • Grafana Mimir or VictoriaMetrics
  • Grafana Loki or ClickHouse for logs
  • S3-compatible object storage
  • Prometheus Alertmanager
  • Grafana
  • PagerDuty for on-call scheduling

Key design decisions

  • Put Kafka between agents and stores so ingestion spikes and store outages cause lag, not data loss, and so the stores can be upgraded independently.
  • Index only a small set of low-cardinality labels for logs and store the body as compressed chunks; full-text indexing everything is the main log cost driver.
  • Enforce cardinality limits at ingestion per tenant and per metric, and make rejections visible on the tenant's own dashboard rather than silently dropping.
  • Run alert evaluation on replicated rulers and rely on Alertmanager clustering to deduplicate, accepting duplicates over missed pages.
  • Monitor the monitoring system with an independent, minimal stack and a dead-man's-switch heartbeat alert to an external service.

Common mistakes

  • Putting user IDs, request IDs or full URLs in metric labels, which multiplies active series and can exhaust ingester memory.
  • Alerting on causes like CPU percentage instead of user-facing symptoms, which produces noisy pages engineers learn to ignore.
  • Querying a year of raw data on a dashboard instead of downsampled rollups, causing slow queries that compete with ingestion.
  • Logging secrets or personal data without redaction, which creates compliance exposure under laws such as India's DPDP Act.
  • Having the alert path depend on the same cluster it monitors, so an outage also silences its own alerts.

What to measure

  • Ingestion lag per Kafka consumer group
  • Active series per tenant and samples rejected by limits
  • Alert evaluation duration and notification delivery latency
  • Query p99 latency for dashboards and log search
  • Pages per on-call shift and share of pages that were actionable

Most-asked interview questions

Subjective questions 33

1How would you handle a high-cardinality explosion in your metrics system?Asked almost every time

First, prevent it: enforce per-tenant and per-metric limits on active series and label values at the ingester, and reject over-limit series with a counter the owning team can see. Second, detect it: track series growth per metric name so we can spot the label that exploded, usually a user ID, pod name churn or raw URL path. Third, fix the source: drop or rewrite the label with relabelling in the collector, bucket URL paths into route templates, and move per-request detail to logs or traces, which handle high cardinality better. For genuine needs, use recording rules to pre-aggregate. The key principle is that one team's bad deploy must never degrade ingestion or alerting for everyone else.

2How do you design alerting that pages the right person once, without missing real incidents?Asked almost every time

I alert on symptoms users feel, ideally SLO burn rates with a fast and a slow window, rather than every resource threshold. Rules use a 'for' duration to skip short blips. Rulers run replicated so a single failure does not miss evaluations, and Alertmanager clustering deduplicates the resulting duplicate notifications. Alertmanager groups alerts by service and cluster so a database outage becomes one page, not fifty, and inhibition suppresses downstream alerts when an upstream one fires. Routing uses team and severity labels, mapped to on-call schedules with escalation if nobody acknowledges. Finally, a heartbeat alert to an external service proves the pipeline itself is alive, and we review noisy alerts after every rotation.

3Walk me through the end-to-end architecture of this metrics, logs and alerting platform.Asked almost every time

Agents on every node scrape Prometheus endpoints and tail container logs. They attach cluster, namespace and service labels, and buffer to local disk if the pipeline is down. They publish compressed batches to separate Kafka topics for metrics and logs, so a traffic spike lands in the queue instead of the stores. Metrics ingesters enforce per-tenant limits, replicate writes and hold recent data in memory and a write-ahead log. Compactors then move blocks to object storage and build downsampled rollups. The log pipeline parses fields, redacts secrets and writes compressed chunks with a small label index. Rulers evaluate recording and alert rules. Alertmanager groups, deduplicates, silences and routes alerts to on-call schedules. Grafana ties dashboards and logs together for whoever gets paged.

4How do you monitor the monitoring platform itself, so you know when it is broken?Asked almost every time

I run meta-monitoring on a separate, minimal stack, ideally in another region or account, so it does not share failure modes with the main platform. It watches ingestion rate, Kafka consumer lag, ingester health, rule evaluation failures and missed iterations, and Alertmanager notification failures. I also use a dead man's switch: an always-firing Watchdog alert sent to an external service. If that heartbeat stops arriving, the external service pages us, because silence means the alert path is broken. I add end-to-end synthetic probes too. A canary writes a known metric and log line, and a checker confirms both are queryable within a freshness target. That catches cases where every component looks healthy but data is not actually flowing.

5The platform is overloaded during a major incident. What do you shed first, and how do you protect the critical signals?Asked almost every time

Load usually peaks exactly when production is broken, so I design shedding to follow priority. Alert-relevant data gets protected capacity: a separate high-priority Kafka topic or quota for metrics that SLO and alert rules use, and dedicated ruler and Alertmanager resources. I shed in this order: expensive ad-hoc queries and long-range dashboards, then debug-level logs, then low-priority tenants' excess series. Every drop increments a visible counter per tenant and reason, so nothing is lost silently. Query concurrency limits and timeouts stop one heavy dashboard from starving the rule evaluator. Agents keep buffering to disk, so delayed data still arrives later. The aim is to degrade exploration first and keep detection and paging working.

6Give me a back-of-the-envelope capacity estimate for the metrics side.Asked almost every time

I state assumptions first. Say 10 million active series scraped every 15 seconds. That is about 667,000 samples per second. Prometheus-style compression stores roughly 1 to 2 bytes per sample, so raw data is around 1.3 MB per second at most, about 115 GB a day before replication. With replication factor 3 in ingesters, hot storage triples, though object storage blocks are deduplicated after compaction. Memory usually dominates: each active series in the head block carries labels and chunk overhead, so active series count, not sample rate, drives ingester sizing. Then I add Kafka retention for a few hours of replay, plus query capacity. Finally I plan headroom for spikes and for losing one zone.

7How do you prevent secrets and personal data from ending up in your log store?Asked almost every time

Defence in depth, as early as possible. First, application logging libraries and code review discourage logging tokens, passwords or personal data. Second, agents or the first pipeline stage run redaction: known secret patterns such as API keys, bearer tokens and card numbers, plus field-based rules that mask fields like email or phone. Redaction happens before data touches Kafka retention or storage, because deleting it later is hard. Third, access is restricted by tenant and team with audit logging. I also limit retention for logs that may contain personal data, which matters for obligations like India's DPDP Act. Finally, I sample stored logs for leaks and treat any leak as an incident: rotate the secret, then purge the affected chunks.

8Explain multi-window, multi-burn-rate SLO alerts and why they beat a raw error-rate threshold.Asked almost every time

Burn rate is how fast you consume the error budget compared with spending it evenly over the SLO window. A burn rate of 1 uses the whole budget exactly over the window. A fast-burn alert pages at a high burn rate measured over a long window, such as one hour, and also requires a short window, such as five minutes, to agree. That combination catches serious incidents quickly and resolves soon after recovery. A slow-burn alert uses a lower burn rate over hours and creates a ticket instead of a page. A raw threshold like 'errors above 1 percent' ignores traffic volume and budget context. It is either noisy or too late. Burn-rate alerts tie paging directly to user impact.

9Why put a queue like Kafka between collectors and storage, and what does it cost you?Very often asked

The queue decouples producers from storage. Traffic spikes during incidents, exactly when observability matters most, so Kafka absorbs bursts and lets ingesters catch up rather than dropping data. It also lets us restart or upgrade the TSDB without losing writes, replay data after a bug, and fan the same stream to multiple consumers like a security pipeline. The costs are extra latency, another stateful system to operate, and storage for retention on the brokers. Ordering only holds within a partition, so I partition by series hash to keep samples for one series together. For alerting freshness, I watch consumer lag closely, because a lagging ingester delays alerts as well as dashboards.

10How would you size local disk buffering on the agents, and what happens when it fills up?Very often asked

I size the buffer to cover the longest pipeline outage I want to survive without loss, for example an hour. The rough formula is node ingest rate times outage duration, compressed, plus headroom, and I check it against node disk quotas. The buffer must be bounded so it can never fill the node disk and hurt the workload. When it fills, the agent drops with a policy: oldest or lowest-priority data first, debug logs before error logs, never silently. It exposes buffer usage and dropped-bytes metrics. Meta-monitoring alerts when buffers keep growing across many nodes, because that means the pipeline, not one node, is down. On recovery, replay is rate-limited so a thousand agents do not flood Kafka at once.

11Why index only labels for logs instead of full-text indexing every field, and when would that be the wrong choice?Very often asked

A full-text index can be as big as the data and costs a lot of CPU at write time. Most log queries start from a known service, namespace or time range anyway. With a small label index, I store compressed chunks cheaply in object storage and filter them with brute-force parallel scans at query time. Ingest becomes cheap and retention affordable. The trade-off is slower needle-in-haystack searches across huge time ranges, and labels must stay low-cardinality, so no request IDs as labels. It is the wrong choice when users mainly run arbitrary full-text search across everything, like security analytics or audit investigations. In those cases a search engine such as Elasticsearch or OpenSearch, or a columnar store, fits better.

12How do you isolate tenants so one noisy team cannot hurt everyone else?Very often asked

Isolation sits at every layer. At ingest, per-tenant limits cover samples per second, active series, labels per series, label value length and log bytes per second, with clear rejection counters. In Kafka, partitioning by tenant and series hash stops one tenant pinning a single partition, and big tenants get more partitions or shuffle sharding across ingesters. On the query path, per-tenant concurrency, series-fetched and bytes-scanned limits apply, plus fair queuing in the query frontend. Rulers can be sharded so one tenant's heavy rules do not delay another's evaluations. Tenant identity comes from authentication, not a client-supplied header. Each tenant gets a usage dashboard, so teams see their own cost and limits before they hit them.

13How does write replication in the ingesters work, and what consistency do queries get?Very often asked

Each series hashes onto a ring, and the write goes to several ingesters, typically three. It succeeds when a quorum, two of three, acknowledges. A single ingester failure then loses no acknowledged data, and writes continue. Queries fan out to the replicas and merge the results, deduplicating identical samples. So the recent window is effectively read with quorum semantics: you see acknowledged data even if one replica is behind. Consistency is eventual at the edges. Data still in agent buffers or Kafka is not visible yet, so I track ingestion delay and expose freshness. After compaction, object storage blocks from the replicas are merged and deduplicated, which cuts long-term storage back to one copy.

14Teams run Prometheus in HA pairs that both remote-write. How do you avoid storing double data?Very often asked

Each replica adds external labels for cluster and replica. The distributor runs HA deduplication: for each cluster it elects one replica as leader and accepts only that replica's samples, dropping the other's. If the leader stops sending for longer than a failover timeout, the distributor switches to the other replica. A short gap or overlap can occur at failover, which is acceptable for monitoring. The replica label is stripped before storage so series identities match. Without this, you double storage and active series, and sum queries double count. The same problem appears for alerts: both replicas fire identical alerts, which is why Alertmanager dedupes by label set.

15How does a query spanning the last 30 days read from both hot and cold storage?Very often asked

A query frontend splits the range into smaller intervals, often by day, checks a results cache and runs the pieces in parallel. Each querier fetches recent data from ingesters and older data from store gateways, which read block indexes and chunks from object storage and cache index headers locally. Results are merged and deduplicated where the windows overlap. For long ranges the querier can pick downsampled blocks based on the step, so a 30-day graph with a one-hour step reads 1-hour rollups instead of raw samples. Limits on series and bytes fetched protect the system. Caching index lookups, chunks and query results matters most, because object storage latency is high.

16What are the pitfalls of downsampling, and how do you keep rollups correct?Very often asked

A single average per window destroys information. You lose spikes, and you cannot correctly compute rates or re-aggregate. So each rollup stores several aggregates: count, sum, min and max, plus counter-aware values so rate() still works across resets. Queries then choose the right aggregate, for example max for latency peaks. Histograms must keep bucket counts, not precomputed percentiles, because percentiles cannot be averaged. Users should know a 1-hour rollup cannot show a two-minute outage, so dashboards auto-select resolution based on step. Downsampling saves query time more than storage. I keep raw data long enough for incident reviews, then expire it per tenant policy.

17What are the trade-offs when choosing 'for' durations and evaluation intervals?Very often asked

The 'for' duration keeps an alert pending until the condition has held across evaluations for that long. That filters brief blips but adds detection delay. Five minutes of 'for' means at least five minutes before anyone is paged. Evaluation interval sets resolution: a 1-minute interval with a 15-second scrape can miss short spikes between evaluations. Very short intervals cost ruler CPU and load the query path. For critical user-facing SLOs I keep 'for' short and rely on burn-rate windows for smoothing. For noisy infrastructure signals I use longer 'for' or keep_firing_for to avoid flapping. If the condition flickers, the pending timer resets, so I smooth with range functions rather than stretching 'for'.

18How do you alert on missing data, when the metric that would show the problem simply stops arriving?Very often asked

Threshold alerts fail silently when the series disappears, because there is nothing to compare. So I add explicit absence checks. absent() or absent_over_time() covers critical series, and up == 0 or missing targets covers scrapes. Freshness alerts track ingestion delay per tenant. For pipelines I alert when Kafka consumer lag grows or when agents report rising buffer usage. I also use synthetic canaries that write known data and verify it end to end. Alerts should be written so 'no data' reads as a problem, not as 'all fine'. In Grafana-managed alerts, that means setting the no-data state deliberately instead of leaving the default.

19How do you make the rule evaluator highly available without causing duplicate pages?Very often asked

I run rulers as a sharded group. Each rule group is assigned to an owner through a hash ring, and replicas can take over if the owner fails. Some setups run two evaluators per group on purpose and rely on Alertmanager to deduplicate, since identical label sets collapse into one alert. I monitor missed and slow evaluations, because a ruler that falls behind is effectively blind. Rulers query ingesters and storage directly, with reserved query capacity, so a dashboard storm cannot starve them. On failover, alert state such as pending timers may reset unless state is restored from the ALERTS_FOR_STATE series. That is why Prometheus persists it.

20How does Alertmanager stay highly available, and what delivery guarantee does it give?Very often asked

Alertmanager runs as a cluster of usually three replicas that gossip silences and notification logs. Rulers send every alert to all replicas. Each replica waits a position-based delay before sending, and checks the shared notification log first, so normally only one notification goes out. The guarantee is at-least-once, not exactly-once. During a network partition, two replicas may both notify. That is the right bias, because a duplicate page is far better than a missed one. Receivers such as paging tools should deduplicate on a stable key, like the group key. I also monitor failed notifications per integration and keep a secondary channel for the case where the primary paging provider is down.

21A team accidentally ships debug logging and log volume jumps tenfold. What does the platform do?Very often asked

Per-tenant and per-stream ingestion rate limits kick in at the agent or distributor. Excess lines are rejected or sampled, and each drop is counted by tenant and reason. Kafka absorbs the short-term surge, so other tenants are unaffected. I give priority to error and warn levels over debug, so the useful signal survives. The tenant gets an automatic notification with a usage dashboard showing what is being dropped. Agents can apply dynamic sampling or filter rules pushed from central config without a redeploy. Longer term, cost attribution per team and log-level defaults in libraries prevent repeats. The key point is that the platform degrades that one tenant visibly, not everyone silently.

22How do you secure the ingestion and query paths?Very often asked

Agents authenticate with mTLS or short-lived tokens tied to workload identity. The gateway derives the tenant from that identity and ignores any client-claimed tenant header, which prevents writing into or reading another tenant's data. All traffic is encrypted in transit. Kafka uses ACLs per topic, and object storage is encrypted at rest with scoped access for platform services only. On the query side, SSO with RBAC maps users and teams to tenants, with audit logs of who queried what, especially for logs. Alert webhooks and notification secrets are kept in a secret manager. Rate limits protect against abusive or runaway queries. I also treat the observability store as sensitive, because logs often contain more than people intend.

23What if the external paging provider has an outage during a real incident?Often asked

I treat the paging provider as a dependency with its own failure mode. Alertmanager metrics for failed notifications per receiver trigger an alert that goes through a different channel, such as a second provider, SMS gateway or chat. Critical routes can fan out to two receivers at the same time, and the receivers dedupe. The dead man's switch heartbeat also detects paging-path failure from the outside. Escalation policies make sure an unacknowledged page reaches a secondary on-call. Teams keep a documented manual fallback, such as a status channel and phone tree, which is tested in game days. Notifications retry with backoff, so alerts queue rather than vanish.

24Kafka consumers are falling behind. How do you detect it and recover?Often asked

I track consumer lag per partition, both in messages and in time. Time lag matters more because it shows how stale dashboards and alerts are. Alerting on lag time, not just message count, tells me when detection is degraded. To recover, I scale ingesters or consumers, keeping partition count at least equal to consumer parallelism, and check whether one hot partition is the bottleneck. If lag is beyond Kafka retention, data is lost, so retention must exceed the worst expected outage. During catch-up, ingesters must accept older samples. That requires an out-of-order window, or prioritising the newest data for alerting and backfilling the rest. Rules should flag low data freshness to on-call rather than fire false 'all clear' results.

25Pull or push for metrics collection: what would you choose here, and why?Often asked

I use pull at the node level: agents scrape local Prometheus endpoints. Then I push from agents into Kafka. Pull gives health for free through the up metric, lets operators control scrape rate, and makes it easy to curl a target to debug. Push from agents to the central pipeline works better across clusters and networks, avoids central scrapers reaching into every cluster, and suits the buffering and batching that Kafka needs. For short-lived batch jobs that end before a scrape, I use push through something like a Pushgateway or OTLP. OpenTelemetry collectors support both models, which helps standardise. Mostly it is a hybrid design with clear ownership.

26How do you correlate metrics, logs and traces so the on-call engineer gets to root cause quickly?Often asked

Correlation depends on consistent identity. Agents attach the same resource labels, cluster, namespace, service and pod, to metrics, logs and traces, ideally following OpenTelemetry semantic conventions. Grafana can then jump from a panel to logs filtered by the same labels and time range. Exemplars attach trace IDs to histogram samples, so a latency spike links straight to example traces. Logs include trace IDs as a parsed field, not a label, to avoid cardinality issues. Every alert carries links to its runbook, dashboard and a pre-filtered logs query, so the engineer does not start from a blank screen. Time synchronisation across nodes also matters, because skew breaks correlation.

27How do retention tiers and data deletion work per tenant, including compliance deletes?Often asked

Each tenant has a policy: how long raw data stays hot, how long downsampled blocks stay in object storage, and when everything expires. Compactors enforce expiry by deleting whole blocks past the window, which is cheap because blocks are time-partitioned. Log chunks expire through object storage lifecycle rules or the compactor. Targeted deletes, such as purging logs that leaked personal data, are harder. I support delete requests that mark series or streams through tombstones, filter them at query time, and rewrite the affected blocks during compaction. Deletion takes time, so I document the SLA. Kafka retention, caches and backups also need bounded lifetimes, or deleted data lingers somewhere.

28How do you roll out ingester upgrades without losing data?Often asked

Ingesters hold recent samples in memory, so restarts need care. Every write goes to a write-ahead log on persistent disk first, so a restarted ingester replays it and recovers. With replication factor 3 and quorum writes, restarting one ingester at a time keeps writes succeeding. I roll one zone at a time with zone-aware replication and wait for each ingester to become ready, WAL replayed and back in the ring, before moving on. Kafka helps further: if ingesters consume from Kafka, they can resume from committed offsets after restart. I watch ingestion errors, ring health and query errors during rollout, and stop automatically if they rise.

29How do you test and govern alert rules so they stay useful?Often asked

Alert rules live in version control and go through review, like code. CI runs syntax checks and unit tests, for example promtool test rules, with synthetic series to confirm an alert fires and resolves as expected. Every paging rule must have an owner team label, a severity, a runbook link and a summary that says what is broken for users. Rules are deployed per tenant through an API, not edited by hand in production. I backtest new rules against historical data to estimate how often they would have fired. Rules that never fire or always fire are reviewed regularly. Game days inject failures to prove the important alerts actually page.

30How do you measure whether alerting is healthy rather than noisy?Often asked

I track pages per on-call shift, the share of pages that were actionable, time to acknowledge, time to resolve, and how often alerts flap or auto-resolve before anyone acts. I also track incidents that were found by customers or humans instead of alerts, which counts as a missed detection. Each page gets a quick post-shift label: actionable, noise or duplicate. That data drives tuning: delete, demote to ticket, adjust 'for', or convert to burn-rate. Grouping effectiveness shows whether one incident caused one notification or fifty. Alert quality should be reviewed like reliability, with clear owners, because alert fatigue directly causes missed real incidents.

31How would you design this platform for multi-region operation and disaster recovery?Often asked

I keep ingestion regional. Agents write to the nearest region's Kafka and storage, so a cross-region link failure does not blind a region, and data residency rules can be honoured. Each region runs its own rulers and Alertmanager for local alerts, so paging keeps working if another region fails. Global views come from a query layer that fans out across regions, accepting partial results with a clear warning. Object storage can be replicated cross-region for durability of long-term blocks. Meta-monitoring for each region runs from a different region. I define RPO and RTO for the platform explicitly and test region failover, including where on-call notifications come from.

32Is ingestion at-least-once or exactly-once, and how do you handle duplicates?Often asked

End to end it is at-least-once. Agents retry on failure, Kafka producers may resend, and consumers may reprocess after a rebalance, so duplicates happen. For metrics this is mostly harmless. A sample is identified by series and timestamp, so the TSDB deduplicates identical samples and rejects conflicting duplicates. Replicated writes and HA pairs are deduplicated at query or compaction time. For logs, duplicate lines are possible. Some stores drop exact duplicates within a stream, and otherwise I accept rare duplicates. Idempotent Kafka producers reduce resends. Exactly-once across agents, Kafka and stores is expensive and unnecessary here. Losing data is the real risk, so I bias toward retries and visible drop counters.

33How would you enforce label conventions across hundreds of teams?Often asked

Standardise the resource labels centrally. The agent attaches cluster, namespace and service, so teams cannot omit or misspell them. I publish a naming guide: base units in metric names, _total for counters, and no unbounded values like user IDs, emails or full URLs as labels. Relabel rules at the agent drop or rewrite known-bad labels. Per-tenant limits on labels per series and label value length catch the rest. A cardinality explorer shows teams their top series and labels. CI linting on instrumentation and dashboards helps too. Golden libraries give teams pre-labelled HTTP and RPC metrics with route templates rather than raw paths, so most teams get it right by default.

Objective questions 33

1Which label is most likely to cause a cardinality problem in a Prometheus-style metric?Asked almost every time
  1. Ahttp_method
  2. Bstatus_code
  3. Cuser_idCorrect answer
  4. Dregion

Why: A user ID has an unbounded number of values, so each new user creates new time series, while the others have small fixed sets.

2What is the purpose of an always-firing 'Watchdog' or dead man's switch alert?Asked almost every time
  1. ATo suppress all other alerts during maintenance
  2. BTo measure query latency in Grafana
  3. CTo test the paging tool's sound settings
  4. DTo detect when the alerting pipeline itself stops working, because the heartbeat goes missingCorrect answer

Why: An external service expects the heartbeat continuously. If it stops arriving, something in the alert path is broken, and the external service pages.

3An alert rule has 'for: 5m'. What happens when its expression first becomes true?Asked almost every time
  1. AIt sends a page and repeats it every 5 minutes
  2. BIt fires immediately and resolves after 5 minutes
  3. CIt enters a pending state and fires only if the condition stays true for 5 minutesCorrect answer
  4. DIt is evaluated only every 5 minutes

Why: The alert stays pending until the condition has held continuously across evaluations for the 'for' duration.

4A metric has labels method (3 values), status (5 values) and pod (100 values). What is the maximum number of series?Asked almost every time
  1. A500
  2. B1,500Correct answer
  3. C300
  4. D108

Why: Series count is the product of label value combinations: 3 × 5 × 100 = 1,500.

5What is the main purpose of downsampling time-series data in older retention tiers?Very often asked
  1. ATo reduce storage and speed up long-range queriesCorrect answer
  2. BTo deduplicate alerts from replicated rulers
  3. CTo encrypt data at rest
  4. DTo make recent alerts fire faster

Why: Downsampling replaces many raw samples with aggregated rollups, cutting storage and the number of points scanned for long time ranges.

6In Prometheus Alertmanager, which feature suppresses alerts for dependent services when an upstream alert is already firing?Very often asked
  1. AInhibition rulesCorrect answer
  2. BRecording rules
  3. CSilences
  4. DGrouping

Why: Inhibition rules mute matching alerts while a specified source alert is firing; silences are manual and time-bound, and grouping only batches notifications.

7Prometheus-style TSDBs achieve roughly 1–2 bytes per sample mainly through which technique?Very often asked
  1. AGzip compression of each individual sample
  2. BStoring only the average value per minute
  3. CFull-text indexing of label values
  4. DDelta-of-delta encoding for timestamps and XOR encoding for float valuesCorrect answer

Why: Gorilla-style compression stores timestamp delta-of-deltas and XORs consecutive values. Regular scrape intervals and slowly changing values make both very compact.

8What ordering guarantee does Kafka provide for messages from these agents?Very often asked
  1. AGlobal ordering across all partitions of a topic
  2. BOrdering within a single partition onlyCorrect answer
  3. CNo ordering guarantees at all
  4. DOrdering only within a consumer group across topics

Why: Kafka orders messages only within a partition. Partitioning by series hash keeps each series' samples in order.

9In Alertmanager, what does group_wait control?Very often asked
  1. AThe rule evaluation interval
  2. BHow long to wait before sending the first notification for a new group, so related alerts can be batchedCorrect answer
  3. CHow often a firing alert is re-sent
  4. DHow long a silence lasts

Why: group_wait delays the first notification of a new group, so alerts that arrive shortly after can join the same notification.

10For a 30-day SLO, what does a burn rate of 14.4 sustained for one hour consume?Very often asked
  1. AAbout 2% of the monthly error budgetCorrect answer
  2. BAbout 14.4% of the monthly error budget
  3. CThe entire monthly error budget
  4. DAbout 0.1% of the monthly error budget

Why: One hour is 1/720 of 30 days, and 14.4/720 equals 0.02, or 2% of the budget. The Google SRE Workbook uses this as a fast-burn paging threshold.

11Why use rate() on a counter instead of graphing the raw counter value?Very often asked
  1. Arate() removes high-cardinality labels
  2. Brate() converts counters into gauges permanently
  3. Crate() computes per-second increase and handles counter resets after restartsCorrect answer
  4. DRaw counters cannot be stored in a TSDB

Why: Counters only increase and reset on restart. rate() detects resets and gives a meaningful per-second rate.

12Which set of aggregates should a downsampled rollup keep so common queries stay correct?Very often asked
  1. AOnly the last value
  2. BCount, sum, min and max, plus counter-aware valuesCorrect answer
  3. COnly the median
  4. DOnly the average

Why: Keeping several aggregates lets queries compute averages, peaks, troughs and rates. A single average loses spikes and breaks rate calculations.

13How should you compute a p99 latency across 50 pods that each expose a histogram?Very often asked
  1. ATake the maximum of each pod's p99
  2. BSum bucket rates across pods by le, then apply histogram_quantileCorrect answer
  3. CTake the median of each pod's p99
  4. DAverage each pod's p99

Why: Percentiles cannot be averaged. Aggregating bucket counts first and then computing the quantile gives a correct estimate.

14With replication factor 3 and quorum writes, how many ingesters must acknowledge a write?Very often asked
  1. A3
  2. BAll ingesters in the ring
  3. C1
  4. D2Correct answer

Why: A quorum of 3 is 2, so a write survives one ingester failure and still succeeds.

15What is the main purpose of an ingester's write-ahead log (WAL)?Very often asked
  1. ATo recover in-memory samples after a crash or restartCorrect answer
  2. BTo store downsampled rollups
  3. CTo index log lines
  4. DTo speed up long-range queries

Why: The WAL persists incoming writes to disk, so the in-memory head block can be rebuilt on restart without losing data.

16Why use recording rules?Very often asked
  1. ATo silence noisy alerts
  2. BTo precompute expensive or frequently used expressions into new series for fast dashboards and alertsCorrect answer
  3. CTo record user sessions in Grafana
  4. DTo log every query for auditing

Why: Recording rules evaluate queries on a schedule and store the results as new series. This makes dashboards and alert rules cheaper and more consistent.

17How is a silence different from an inhibition in Alertmanager?Very often asked
  1. AThey are identical features
  2. BA silence deletes alerts from the ruler
  3. CAn inhibition only applies to log alerts
  4. DA silence is a time-bound, manually created mute matching labels; an inhibition mutes alerts automatically when a matching source alert is firingCorrect answer

Why: Silences are explicit and expire, which suits maintenance windows. Inhibitions are rule-based and depend on another alert currently firing.

18An agent's bounded disk buffer is full during a long pipeline outage. What is the best behaviour?Very often asked
  1. ACrash the agent so Kubernetes restarts it
  2. BSilently discard all new data
  3. CKeep writing until the node disk is full
  4. DDrop lowest-priority data first and expose dropped-data countersCorrect answer

Why: The buffer must never harm the workload. Prioritised dropping keeps the most important data, and counters make the loss visible.

19Which PromQL function helps alert when a critical series stops reporting entirely?Very often asked
  1. Atopk()
  2. Bincrease()
  3. Crate()
  4. Dabsent() or absent_over_time()Correct answer

Why: absent() returns a result when no matching series exists. A threshold rule on missing data would otherwise never fire.

20Kafka consumer lag measured in time is growing for the metrics topic. What does it most directly mean?Very often asked
  1. AAlertmanager is down
  2. BDashboards and alerts are evaluating stale dataCorrect answer
  3. CAgents are dropping data
  4. DStorage is out of space

Why: Lag means ingesters have not consumed recent data yet. Queries and rules see an older picture, so detection is delayed.

21Where should secrets and personal data ideally be redacted from logs?Very often asked
  1. ADuring monthly compaction
  2. BNever; access control is enough
  3. CIn Grafana when displaying results
  4. DAs early as possible, at the agent or first pipeline stage before durable storageCorrect answer

Why: Early redaction stops sensitive data from spreading into Kafka retention, caches, storage and backups, where removing it is hard.

22How should the platform determine an incoming write's tenant ID?Very often asked
  1. ARandomly, for load balancing
  2. BFrom a header the client sets freely
  3. CFrom the authenticated identity, such as an mTLS certificate or token, enforced at the gatewayCorrect answer
  4. DFrom the metric name prefix

Why: Deriving the tenant from authenticated identity prevents a client from writing into or reading another tenant's data.

23One million active series are scraped every 15 seconds. Roughly how many samples per second is that?Very often asked
  1. AAbout 15,000,000
  2. BAbout 15,000
  3. CAbout 66,700Correct answer
  4. DAbout 1,000,000

Why: Each series yields one sample every 15 seconds, so 1,000,000 ÷ 15 ≈ 66,667 samples per second.

24Partitioning the metrics topic only by tenant ID most likely causes which problem?Very often asked
  1. ADuplicate alerts
  2. BData being encrypted twice
  3. CLost ordering within a series
  4. DA hot partition when one large tenant sends most of the trafficCorrect answer

Why: All of a big tenant's data lands on one partition and one consumer. Adding series hash spreads that load.

25Which alert is most appropriate to page an on-call engineer at night?Very often asked
  1. AA node's CPU is above 80% for one minute
  2. BThe checkout SLO error budget is burning at a high rate over both 1h and 5m windowsCorrect answer
  3. CA disk will be full in 30 days
  4. DA deployment finished successfully

Why: Pages should be for urgent, user-impacting symptoms. A fast multi-window burn rate on a key SLO is both.

26Which Alertmanager setting controls how often a notification is re-sent for an unchanged, still-firing group?Often asked
  1. Aevaluation_interval
  2. Bscrape_interval
  3. Cgroup_interval
  4. Drepeat_intervalCorrect answer

Why: repeat_interval sets the re-notification period for a group whose alerts have not changed. group_interval covers sending when new alerts join an existing group.

27In a label-indexed log store like Loki, what is indexed?Often asked
  1. AEvery word in every log line
  2. BOnly the stream labels, while log content sits in compressed chunksCorrect answer
  3. CNothing at all; every query scans all data
  4. DOnly timestamps

Why: Only stream labels are indexed. Line content is filtered by scanning chunks at query time, which keeps the index small and ingest cheap.

28In Cortex or Mimir, how are samples from an HA pair of Prometheus servers deduplicated at ingest?Often asked
  1. ABy comparing every sample value
  2. BBy electing one replica per cluster, using cluster and replica labels, and accepting only its samplesCorrect answer
  3. CBy dropping every other sample
  4. DBy using Kafka exactly-once transactions

Why: The distributor tracks a leader replica per cluster label and drops samples from the other replica until failover.

29What is one advantage of pull-based scraping?Often asked
  1. AIt needs no service discovery
  2. BIt removes the need for labels
  3. CIt works best for jobs that finish in under a second
  4. DThe scraper generates an 'up' metric, so a down target is detected automaticallyCorrect answer

Why: A failed scrape sets up to 0. That is an immediate health signal which push models must build separately.

30What is the appropriate way to get metrics from a short-lived batch job that finishes before a scrape?Often asked
  1. AIncrease the scrape interval
  2. BPush them through a Pushgateway or an OTLP pushCorrect answer
  3. CIgnore batch jobs
  4. DWrite them into log lines only

Why: Short-lived jobs may never be scraped. Pushing their final metrics to an intermediary or collector makes them observable.

31What do exemplars provide in this platform?Often asked
  1. ATrace IDs attached to specific metric samples, linking metrics to tracesCorrect answer
  2. BSample dashboards for new tenants
  3. CCompressed log chunks
  4. DExample alert rules

Why: Exemplars attach a trace reference to a sample, such as a histogram bucket, so you can jump from a latency spike to a matching trace.

32Why store compacted TSDB blocks in object storage?Often asked
  1. AIt is durable, scalable and cheap per GB for large volumes of immutable dataCorrect answer
  2. BIt supports in-place sample updates
  3. CIt removes the need for indexes
  4. DIt has the lowest read latency

Why: Immutable blocks suit object storage's cheap, durable capacity. Caches and store gateways hide its higher latency.

33What delivery semantics does an HA Alertmanager cluster provide for notifications?Often asked
  1. AAt-most-once
  2. BAt-least-once, so receivers should deduplicateCorrect answer
  3. CBest-effort with no retries
  4. DExactly-once

Why: Replicas coordinate through gossip but can both send during partitions. The system deliberately prefers a duplicate page over a missed one.

Track your progress through every blueprint in your dashboard.

Start learning