博文

目前显示的是 十一月, 2026的博文

Latency Histograms Need a Bucket Contract Before You Merge Them

Two applications both report a histogram called checkout_latency. One uses milliseconds, the other seconds. Or they share a unit but use different bucket boundaries. Adding the arrays by position produces a plausible chart with an undefined meaning. Before merging latency histograms, match the measurement, unit, population, time interval, aggregation temporality, and bucket layout. A bucket count is only meaningful together with the boundary and counting convention that produced it. Know whether a bucket is cumulative Prometheus metric types describes classic histogram buckets as cumulative counts with inclusive upper bounds. An observation of 150 ms contributes to both the 200 ms and 300 ms buckets. Summing all those buckets would count some observations repeatedly. The positive-infinity bucket represents the observation count. This article uses that classic, cumulative convention. Do not copy the array interpretation into every telemetry format. The OpenTelemetry metrics data mo...