From 58a8ca4588dbaa27f1b39e7d1ff9e6e1683d00bb Mon Sep 17 00:00:00 2001 From: beorn7 Date: Wed, 19 Oct 2022 18:38:57 +0200 Subject: [PATCH] examples: Adjust doc comment for native histograms Signed-off-by: beorn7 --- examples/random/main.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/random/main.go b/examples/random/main.go index 72f1f65f5..13295148c 100644 --- a/examples/random/main.go +++ b/examples/random/main.go @@ -53,10 +53,17 @@ func main() { }, []string{"service"}, ) - // The same as above, but now as a histogram, and only for the normal - // distribution. The buckets are targeted to the parameters of the - // normal distribution, with 20 buckets centered on the mean, each - // half-sigma wide. + // The same as above, but now as a histogram, and only for the + // normal distribution. The histogram features both conventional + // buckets as well as sparse buckets, the latter needed for the + // experimental native histograms (ingested by a Prometheus + // server v2.40 with the corresponding feature flag + // enabled). The conventional buckets are targeted to the + // parameters of the normal distribution, with 20 buckets + // centered on the mean, each half-sigma wide. The sparse + // buckets are always centered on zero, with a growth factor of + // one bucket to the text of (at most) 1.1. (The precise factor + // is 2^2^-3 = 1.0905077...) rpcDurationsHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{ Name: "rpc_durations_histogram_seconds", Help: "RPC latency distributions.",