What are native (sparse) histograms in Prometheus?
AdvancedConceptObservability Fundamentals & Signals
Answer
Native histograms store the whole distribution as a single series with exponential buckets chosen automatically by a schema (resolution factor), instead of one series per le bucket. Benefits: high resolution with far fewer series, no need to pick bucket boundaries, and cheaper aggregation.
They became stable in Prometheus 3.x (earlier behind --enable-feature=native-histograms). Scraping them needs the protobuf exposition format or OTLP. Querying uses the same functions:
histogram_quantile(0.99, sum by (job) (rate(http_request_duration_seconds[5m])))
Note: no _bucket suffix and no le label for native histograms.
More on Observability Fundamentals & Signals
What is the difference between monitoring and observability?BeginnerWhat are the "three pillars" of observability, and what is the fourth signal people now add?BeginnerWhen would you reach for metrics, logs, traces or profiles during an incident?BeginnerWhat are the four Prometheus metric types?BeginnerWhy should you never use a gauge to count requests?BeginnerHistogram vs summary: what is the real difference, and which do you choose?Intermediate