Chapter Thirteen · Problem Seven

Metrics Monitoring and Alerting

A hundred thousand servers, two million points a second, and an alarm that cannot depend on itself.

4 lessons · 45 minutes
The Question

"Design a system that collects metrics from a hundred thousand servers, draws dashboards, and pages an engineer when something breaks."

Read that question as three jobs, and only one of them is a storage problem. Collecting is the largest write rate this book has met so far. Dashboards are reads over data nobody ever changes. And paging matters most at the exact moment the other two are failing, so it cannot simply sit on top of them.

Chapter 3 gives you the split: When One Machine Is Not Enough for the sums, and Hot Partitions for why the key cannot be time alone. Chapter 6 gives you most of the rest. Queues, Logs and Pub-Sub supplies the log in the middle. Backpressure and Load Shedding supplies the refusal at the door and the replay that arrives as a burst. Regions and the Arithmetic of Nines supplies parts in series and copies in parallel. From Chapter 4, CAP and PACELC, Precisely is why two copies need not wait for each other, and Concurrent Writes and Conflicts is why a repeated point is no conflict at all.

The problem is pitched at senior. A mid-level candidate reaches a time-series store and the arithmetic. A staff candidate is judged on who pays for a label and who watches the watcher. Three parts carry the weight. The first is a write-heavy time series: millions of points a second, with compression, downsampling to coarser summaries as data ages, and retention tiers. The second is cardinality, the count of distinct series, which one label can multiply. The third is an alert path that stays up when what it watches is down.

Observability Deep Dive owns the use of a monitoring stack: what to alert on and how to set objectives. This chapter designs the stack itself.

Put 45 minutes on a clock before the first lesson, and build your own version on paper. Stop scoping at minute 10, have a working design by 20 and a scaled one by 30, and spend the rest on whatever you trust least. One test for your sketch at the end: take your collector away, and ask who gets paged.

The 45 minutes of this problem, lesson by lesson
Scopeminutes 0-10
→
First Designminutes 10-20
→
Scaling Itminutes 20-30
→
Deep Divesminutes 30-45

Lessons in This Chapter