Skip to content

[docs] Add native histograms documentation and example - #1518

Merged
manugarg merged 2 commits into
mainfrom
docs-native-histograms
Oct 4, 2026
Merged

manugarg merged 2 commits into
mainfrom
docs-native-histograms

Conversation

@manugarg

@manugarg manugarg commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Last part of native histogram support (#1480): documentation and an example for native_buckets, which landed in #1514 to #1517.

Docs

All of it is in the "Percentiles, Histograms, and Distributions" how-to, where distributions are documented today.

  • Native histograms — what they are and why you'd use them, the config, and a note that they're experimental.
  • Resolution (schema) — a table of schema against bucket width and buckets for each power of 2.
  • How native histograms are exported — by surfacer: Prometheus, OTel, Stackdriver (skipped), and the ones that get regular buckets.
  • Mixed probes — a note to set latency_metric_name for the probes that use latency_distribution, when only some of them do.
  • Native histograms in Prometheus — scraping with scrape_native_histograms: true, when cloudprober serves the protobuf format, what a text scrape gets, the OTLP route, example queries, and NHCB conversion as the alternative for those who only want fewer time series.
  • Proto listing on that page now has native_buckets. It shows the proto in its proto2 form, with the defaults in the proto, which is what dist.proto becomes with [metrics] Switch dist.proto to proto2 #1519.

Config reference pages are not touched; a separate workflow generates them from the protos.

Example

examples/percentiles/native_histograms.cfg: an HTTP probe with native_buckets {} and latency_metric_name: "latency_dist", next to a DNS probe that exports latency as a number. Prometheus scrape config and a p95 query are in the comments. Also added a "Percentiles" row to examples/README.md.

Testing

  • The example passes -configtest and tools/test_example_configs.sh.
  • Ran the example with Prometheus 3.15 scraping it: latency_dist was stored as native histograms, latency of the DNS probe as a number, and the two queries in the docs returned sensible values.
  • The docs site builds with Hugo, and the new sections, tables and anchors render.

Document native histograms (native_buckets) in the percentiles how-to:
what they are, the schema, how each surfacer exports them, and how to
get them into Prometheus, by scraping or over OTLP. Add an example
config as well.

Part of #1480.
@manugarg
manugarg marked this pull request as ready for review October 4, 2026 07:51
@manugarg manugarg added this to the v0.14.7 milestone Oct 4, 2026
@manugarg
manugarg merged commit 18f70cf into main Oct 4, 2026
13 checks passed
@manugarg
manugarg deleted the docs-native-histograms branch October 4, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant