-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
metrics: add H2 Histogram option to improve histogram granularity #6897
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine w/ this. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple of suggestions on code style and some formatting nits, but this look good to me.
There is one place I mentioned where I think some more description on what the examples are doing would help people understand the configuration options.
c228fd3
to
d3d8532
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple more small things.
a0677a1
to
f888b85
Compare
f888b85
to
e1b2758
Compare
Motivation
Closes: #6896
Solution
This PR introduces a configurable new histogram for the poll-time histogram based on H2 Histograms. As part of this, three APIs are deprecated:
metrics_poll_count_histogram_scale
metrics_poll_count_histogram_resolution
metrics_poll_count_histogram_buckets
Since I suspect these are commonly used, I thought it was worth a little added complexity to provide a graceful path to removing them.
They are replaced with
metrics_poll_count_histogram_configuration
that accepts a histogram configuration object. The intention of this change is to provide more knobs when configuring histograms (as customers will want with the H2 histogram).The default histogram remains the linear histogram with 10 buckets. The default H2 histogram provides a 25% error bound from 100ns to 60s of poll time and uses about 1KB of storage. This is configurable by customers as well.
The
h2_histogram
code is fairly complex compared to the code for the other histogram modes, so I isolated it into its own module. I brought back proptest to test invariants across a wide range of possible parameters–since there isn't any actual branching in this code, we don't get any value from making them fuzz tests (other than that they are a little more annoying to run).