Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves histogram buckets over the default set #355

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

bdarfler
Copy link
Contributor

@bdarfler bdarfler commented Nov 23, 2021

This is an attempt at a usable set of buckets for a wide range of metrics

Which problem is this PR solving?

Fixes #115

As noted in the issue, the default buckets in the go client are as follows:

DefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}

… and from the docs …

DefBuckets are the default Histogram buckets. The default buckets are tailored to broadly measure the response time (in seconds) of a network service. Most likely, however, you will be required to define buckets customized to your use case.

Additionally from the docs …

Buckets defines the buckets into which observations are counted. Each element in the slice is the upper inclusive bound of a bucket. The values must be sorted in strictly increasing order. There is no need to add a highest bucket with +Inf bound, it will be added implicitly. The default value is DefBuckets.

In the end, the cache_entries metric therefore always ends up in the implicit +inf bucket and makes the metric nearly useless. You just know your cache_entries are more than 10.

For example "your stuff is more than 10!":

graphs that show that these only go to 10

This is an attempt at a usable set of buckets for a wide range of metrics

Fixes #115
Closes #346
@akasprzok
Copy link

I'm on board with this!

@bdarfler bdarfler marked this pull request as ready for review November 29, 2021 15:52
@bdarfler bdarfler requested a review from a team November 29, 2021 15:52
Copy link
Member

@robbkidd robbkidd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These buckets appear to be more better.

a bucket

@bdarfler bdarfler merged commit 5fe349d into main Nov 29, 2021
@bdarfler bdarfler deleted the better-histogram-buckets branch November 29, 2021 16:09
@robbkidd robbkidd added type: enhancement New feature or request version: bump minor A PR that adds behavior, but is backwards-compatible. labels Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request version: bump minor A PR that adds behavior, but is backwards-compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bucket sizes for Prometheus histograms
3 participants