Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Global Service Metrics Monitoring and Alerting Platform

Design a global platform that turns microservice metrics into honest health dashboards and timely, deduplicated anomaly alerts.

Problem statement

For this exercise, assume platform operators monitor services deployed across regions. Metric producers send timestamped numeric samples containing a stable sample ID, service and region identity, metric name, event timestamp, and value.

Operators need current service-health dashboards, historical metric queries, and notifications when a configured anomaly predicate over a windowed aggregate remains true. Raw samples remain queryable for 30 days, while five-minute and hourly rollups remain queryable for 13 months.

An alert instance moves through normal, pending, firing, and resolved states, and each firing or resolved transition must emit one outward notification despite retries. Replayed samples must not change aggregates twice, and missing or stale telemetry must appear as unknown rather than healthy.

A healthy region must continue ingesting metrics and evaluating its local alerts during a single-region or inter-region network failure; global dashboards may return explicitly marked partial or stale results until recovery.

Distributed tracing, log search, automatic remediation, and authoring a machine-learning anomaly model are outside scope; the platform evaluates supplied predicates over metric streams.

Explain how the existing pipeline scales during sudden traffic spikes while preserving the meaning of its checkpoints, sample identities, and alert state. Show how operators distinguish processing delay, missing data, and an incorrect rule trigger using evidence from this pipeline.

Dynamic rule changes must have an explicit activation boundary that does not interrupt in-flight streams; retain the existing policy-version and alert-lifecycle guarantees. This is diagnosis of the monitoring pipeline itself, not a new distributed-tracing or log-search product.

For this exercise, assume each configured notification destination durably deduplicates repeated sends using the pair (transition ID, destination), retaining that identity for the full delivery and reconciliation lifetime. Retrying the same key cannot create a second outward notification.

A transport timeout remains an uncertain delivery outcome and is reconciled or retried under that original key.

Explain the alternative when a destination lacks this contract: local state and an outbox alone cannot guarantee one external effect; retries provide at-least-once delivery with possible duplicates, while withholding an uncertain retry may leave delivery unresolved.

For this exercise, also be ready to explain concretely how the platform stores metric samples, series metadata, and rollups: how series are identified and indexed, how recent data is laid out for fast writes and reads, how data is compacted and downsampled, and how the 30-day raw and 13-month rollup retention limits are enforced at the stated series count and write rate.

What to build

  1. Accept metric samples from services in every active region and make retries safe without double counting.
  2. Show current service health with freshness and coverage so missing telemetry is distinguishable from healthy telemetry.
  3. Serve recent and historical dashboard queries over raw metrics and retained rollups.
  4. Evaluate versioned anomaly policies and deliver one notification for each firing and resolved transition.

At scale

  • For this exercise, assume 1 million metric samples per second on average with bursts up to 3 million per second across as many as 100 million active series in 50 regions.
  • For this exercise, assume 10,000 concurrent dashboard viewers; common dashboard queries should complete within 2 seconds at p95 and show data no more than 15 seconds stale when contributing regions are healthy.
  • For this exercise, assume firing and resolved alert transitions should be delivered within 30 seconds at p95 after the qualifying metric window closes, without duplicate outward notifications for one transition.
  • For this exercise, assume raw samples are queryable for 30 days and five-minute plus hourly rollups for 13 months; a regional or inter-region failure must not stop healthy regions from ingesting and evaluating local alerts.