Interview Prep/Monitoring & Observability/Observability Fundamentals & Signals

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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Observability Fundamentals & Signals