What is downsampling, and what does it not do?
AdvancedConceptKubernetes Monitoring, Scale & Cloud
Answer
Downsampling (Thanos compactor) creates lower-resolution copies of blocks: 5-minute resolution for blocks older than 40 hours and 1-hour resolution for blocks older than 10 days. Each downsampled point stores aggregates (count, sum, min, max, counter) so rate() and _over_time still work.
thanos compact --retention.resolution-raw=30d \
--retention.resolution-5m=180d --retention.resolution-1h=2y --wait
What it does not do:
- It does not save space by itself: it adds blocks. Savings only come from shorter retention on raw data.
- It does not reduce series count or cardinality.
- It loses detail: a 1-minute spike disappears in 1h data, and
[5m]windows on 1h data return nothing.
It speeds up long-range queries, which is its real purpose.
More on Kubernetes Monitoring, Scale & Cloud
What is kube-prometheus-stack and what does it install?BeginnerWhat CRDs does the Prometheus Operator provide?IntermediateHow does the Prometheus Operator decide which ServiceMonitors to load?IntermediateWhich cAdvisor container memory metric should you watch, and why?IntermediateHow do metrics-server and the custom/external metrics APIs relate to HPA?IntermediateWhich kube-state-metrics metrics do you use most?Beginner