Katkat

Design a Fleet Metrics Monitoring Platform, Then Go Deep

OpenAISoftware Engineer · Technical Screen

Last updated

Sketch an end-to-end metrics pipeline for a large service fleet, then choose one or two components — cardinality control, storage layout, or alert evaluation — and design them in real depth.

Design a platform that monitors a fleet of services and hosts. Each instance emits numeric measurements over time — request counts, error counts, latencies, CPU and memory usage — and the platform needs to collect them, store them as time series, let engineers build dashboards against them, and alert an on-call engineer when a rule is violated.

You're not expected to design every box in equal depth. Sketch the full pipeline briefly first, then pick one or two areas and go deep.

Clarifying Questions

  • Roughly how many hosts and services are being monitored, how many distinct measurements does each emit, and at what interval? How many distinct active time series does that imply?
  • Does each instance push its own measurements out, or does something poll each one on a schedule?
  • For how many months does history need to stick around, and does it stay at full resolution the whole time?
  • Can a dashboard tolerate showing slightly stale numbers, and can an alert tolerate occasionally missing a handful of points without it mattering?
  • Is this platform only for numeric measurements, or does it also need to ingest logs or distributed traces?
  • Once a rule fires, how does the notification reach a human, and do related alerts need to be grouped or temporarily muted?

Signals of a Strong Design

  • A precise shape for a single measurement and the identifying labels attached to it, with numbers derived from that shape for how fast points arrive, how many series stay active, and how much space they occupy
  • A short end-to-end pipeline sketch, followed by a clearly justified choice of where to go deep
  • Storage suited to how time-series data is actually written (append-heavy, time-ordered) and read (recent data at full resolution, old data mostly over wide ranges)
  • For a storage deep-dive: compression, partitioning by time, and a downsampling or rollup strategy as data ages
  • For a cardinality deep-dive: what causes a label combination explosion, and how to bound or detect it before it degrades the whole system
  • For an alerting deep-dive: how evaluation stays correct and timely even as the number of active rules and series grows, and how a single noisy series is kept from paging someone needlessly

Scale to reason from

Assume on the order of 50,000 hosts, each running a handful of services and emitting on the order of a few hundred distinct metric names at a 10-second interval, with labels for host, service, and deployment version. That alone implies tens of millions of active series once every label combination is counted — the cardinality estimate is usually the first thing worth writing down, because it decides which storage and query approaches are even feasible.

Hints

Hint 1

Write down exactly what one data point looks like, labels included, before sketching any boxes — the number of distinct label-value combinations drives most of the painful scaling decisions here, more than raw point volume does.

Hint 2

State out loud which deep-dive area holds the hardest problem at your estimated scale, and why, before diving in — a focused deep dive beats a shallow tour of every component.

Hint 3

Recent data and old data are read completely differently; think about what that difference lets you do to storage and resolution.

Hint 4

Decide what 'correct' means for an alert under partial data loss before designing the evaluator — silently skipping evaluation is different from deliberately failing open or closed.

Follow-up questions

  • How would you detect that the downsampling job itself has fallen behind before it silently drops data nobody downsampled in time?
  • How would you design alert rule evaluation to tolerate a query-service outage without either missing real incidents or paging on stale data?
  • A single flapping series causes a rule to fire and resolve repeatedly within a minute — how would you prevent alert fatigue from that?
  • How would you support a rule that needs to compare a metric against its own value from a week ago?