Metrics Monitoring System (Datadog) 00:00:01 A thousand counters arrive as one point A commuter app emits a request count on every search. Sending each increment as an independent remote write is expensive. Design an illustrative metrics system that aggregates compatible observations locally before ingestion. It sends plus 1 to the agent by UDP and does not wait. A thousand compatible increments in one interval can be aggregated into one count point in this example. A fixed-size buffer holds batches when the network fails. The oldest goes first. Token, names and labels. One metric is over its series limit: only its new series are refused. The log has it on several disks, so the gateway answers 202 with both counts. The gateway validates identity, type and label policy before durable intake. A locally submitted packet, an accepted time-series sample and an evaluated alert are three different milestones. 00:00:55 A series is a label set with a history Two ingesters consume the incoming log under a deliberate redundancy policy. A new metric-and-label combination creates index work. Later samples of that series can reuse its identity. Watch what a crash forces the recovering ingester to reconstruct. The same partition goes to ingesters in two zones. For a new series, each label gets its id. Known series skip this. Ingester A stops. B still has everything, so queries go there. This configured example recovers its checkpoint and replays the relevant retained input to rebuild recent state. After two hours each twin uploads a block that never changes again. Store checkpoints together with meaningful input positions. Keep enough upstream history to bridge the worst recovery interval. Query-time deduplication may be necessary if redundant writers produce equivalent observations. 00:01:46 Do not average the average of two stations The operations dashboard combines stations with very different request counts. An arithmetic mean of their local averages would give a nearly empty station the same influence as the busiest terminus. Average CPU by host, last 6 hours. Six hours at 10 s is 2,160 points a line. Merge six into one and draw 360. The closed first 4 hours were drawn 30 seconds ago. Each participating shard supplies the components needed to compute the requested aggregate correctly. Sum over count gives the right average. The panel is drawn. For a weighted mean, merge sums and counts, then divide the combined sum by the combined count. Choose a query step appropriate to the requested time range and keep authorization constraints in any shared cache key. 00:02:35 One innocent-looking label changes the storage bill A developer wants to attach a rider identifier to an existing metric with forty series. Suppose there are a million observed riders and that every combination is possible. How large is the resulting series space? One metric, 40 series. A million users would make 40 million series of one metric. The gateway stops at 10,000. The 40 old series continue, and the owner gets the label's name. Remove the unbounded dimension and combine compatible counts correctly. Preserve the intended measurement after changing its labels. The illustrative ceiling is forty million. A gateway limit bounds one failure mode, but dropping an attribute upstream may require re-aggregating measurements with the correct metric semantics. Diagnose individual requests in a more suitable, access-controlled store. 00:03:26 The alarm system has an alarm of its own The measured services keep running while the monitoring system cannot evaluate its rules. No page arrives. Can an operator conclude that all stations are healthy? One rule is always true. Its signal leaves our network each minute. Ingesters cannot be read. No rule can be checked, so no alert arrives. It looks peaceful. The outside watcher misses three signals and calls the on-call person by its own path. An independent watcher can notice the absence of a regularly expected heartbeat. Its delivery path must survive the failure being tested. Now the team can distinguish a quiet business metric, a lost observation and a broken alarm system.