Why reduce resolution
Raw metrics may arrive every few seconds. Keeping that resolution for years is expensive and rarely useful. Downsampling aggregates fine grained points into coarser ones, and the stored aggregates are called rollups.
How a rollup is built
For each window, such as five minutes or one hour, the system computes summary statistics over the raw points:
- Sum and count for averaging later.
- Min and max to preserve extremes.
- Last for gauge like values.
Storing sum and count separately lets you average correctly even when re aggregating across windows.
Tiered resolutions
Systems keep several tiers: full resolution for recent data, then progressively coarser rollups for older data. Queries pick the coarsest tier that still answers the question fast.
Pitfalls
- Averaging averages is wrong, so keep sum and count.
- Percentiles do not roll up simply and need sketches.
Key idea
Downsampling builds rollups of sum, count, min, and max per window, and tiered resolutions let old data stay cheap while remaining queryable.