11. Classic design problemsMetrics system
Metrics system
A metrics system, like Prometheus or Datadog, collects numbers that services report over time, such as request counts, latencies and CPU usage, stores them as time series and lets you graph and alert on them. Each series is identified by a name plus tags like region or endpoint, and data arrives as a constant, enormous stream of small writes. Two things make the design interesting. Cardinality: every distinct combination of tag values is a separate series, so tagging by something unbounded like user ID can create millions and overwhelm memory. And retention: recent data is kept at fine resolution, while older data is downsampled into coarser averages so you can keep years of history cheaply.
In this lesson: Time-series ingest and downsampling.