System design · 4 of 16
Mid
Senior
- Monitoring and alerting for 100 servicesSRE · Platform · DevOps
- Secrets management platformDevOps · Platform · SRE
- Multi-region active-active serviceSRE · Platform
- Distributed job scheduler (cron at scale)SRE · Platform
- Internal developer platform (IDP)Platform
- Multi-tenant Kubernetes platformPlatform · DevOps · SRE
- GitOps for a fleet of 100 clustersPlatform · DevOps
- ML training platform and feature storeMLOps · Platform
- LLM inference platformMLOps · Platform · SRE
SENIOR · 14 MIN · SRE · PLATFORM · DEVOPS
Monitoring and alerting for 100 services
Prometheus per cluster, long-term storage, logs and traces, SLO dashboards and alert routing that pages only for what matters.
- Peak load
- 170,000 samples/s
- Availability target
- 99.95% (alerting)
- RTO: back up within
- 15 min
- RPO: data you can lose
- ~2 hours buffered
← Swipe sideways to see the whole diagram →
The question
"Design monitoring and alerting for a company with 100 services running on several Kubernetes clusters in two regions."
Requirements
- Metrics, logs and traces for every service, with standard dashboards.
- SLOs per service, and alerts that page only when users are hurt.
- Keep metrics for 13 months for capacity planning; logs 14 days hot, 1 year archived.
- The monitoring system must keep working when a cluster is having problems.
Quick numbers
| Item | Assumption | Result |
|---|---|---|
| Pods | 5,000 | each exposes ~500 time series |
| Active series | 5,000 × 500 | ~2.5 million |
| Samples | every 15 s | ~170,000 samples per second |
| Logs | 5,000 pods × 1 KB/s | ~5 GB/s raw, ~400 TB/day: needs sampling and dropping debug logs |
How it works
- Every service exposes
/metrics; node and kube-state exporters add cluster data. The OpenTelemetry collector gathers logs and traces. - A Prometheus in each cluster scrapes every 15 seconds and evaluates recording rules and alert rules locally, so alerts still fire if the central system is down.
- Prometheus remote-writes to a long-term store (Mimir or Thanos on S3) for global queries and 13-month history.
- Logs go to Loki (cheap, label-indexed) and traces to Tempo.
- Grafana shows standard dashboards for every service (golden signals) and SLO burn charts.
- Alertmanager groups and de-duplicates alerts and routes them: critical burn-rate alerts page on-call through PagerDuty; warnings go to Slack or tickets.
Remember it: alert on symptoms (users see errors or slowness), investigate with causes (CPU, disk, queues) on dashboards.
Key decisions
| Decision | Choice | Why |
|---|---|---|
| Alert evaluation | in each cluster | no single point of failure for paging |
| Long-term storage | object storage (S3) | cheap, durable, scales |
| Cardinality | ban user IDs and request IDs as labels | stops series counts exploding |
| Paging | multi-window burn-rate SLO alerts | pages fast for real outages, tickets for slow burns |
| Standards | dashboards and alerts generated from code | every new service gets them for free |
What breaks and how it heals
- Who monitors the monitor? A dead-man's switch alert that always fires; if the paging service stops receiving it, it pages.
- Cardinality explosion: per-tenant series limits in Mimir and alerts on series growth.
- Alert storm in an outage: grouping by service and region plus inhibition rules (if the cluster is down, suppress the alerts for every pod in it).
Making it bigger
- Shard Prometheus by team, or use the Prometheus Agent mode that only forwards.
- Tail-based sampling for traces: keep slow and failed traces, sample the rest.
High availability and disaster recovery
| Target | Number | How it is met |
|---|---|---|
| Alerting availability | 99.95% | two identical Prometheus replicas scrape the same targets; Alertmanager runs as a 3-node cluster and removes duplicates |
| Long-term store node fails | no data lost | Mimir/Thanos keep 3 copies of new data across 3 AZs; blocks land in S3 (99.999999999% durability) |
| Remote write target down | nothing lost for ~2 hours | Prometheus keeps a write-ahead log and retries; fix the store within that window |
| Grafana lost | RTO 15 min | dashboards and alert rules are code in Git; redeploy |
| Whole monitoring region fails | you still get paged | a small "meta-monitoring" setup in another region, plus a dead-man's switch alert |
What interviewers listen for
- Numbers on series and log volume, and how you control cardinality and cost.
- SLO-based alerting, routing and on-call health.
- Resilience of the monitoring system itself.