client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

Proposal: simplify Go runtime/metrics histogram buckets

Open bboreham opened this issue 1 year ago • 7 comments

I looked at go_gc_heap_allocs_by_size_bytes_bucket, and found it strange that the buckets include le="24.999999999999996" and le="64.99999999999999".

With help from @beorn7 I believe this is because the bucket is defined as "less than 25", "less than 65", etc., modified by math.NextAfter(): https://github.com/prometheus/client_golang/blob/a09a1d34cbc74daa8ed70234b99467a30b020a40/prometheus/go_collector_latest.go#L555

I propose we take advantage of the knowledge that fractional values do not show up in byte counts, and adjust the buckets as le="24", le="64", ...

This would be a breaking change for anyone relying on the exact values, but overall a benefit.

I'm using v1.15.1.

bboreham avatar Jun 07 '23 14:06 bboreham