-
Notifications
You must be signed in to change notification settings - Fork 86
prometheusbp: add support for native histograms #709
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
base: master
Are you sure you want to change the base?
prometheusbp: add support for native histograms #709
Conversation
69e31fa to
b06a4cd
Compare
|
|
||
| import "time" | ||
|
|
||
| const ( |
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.
Not a golang expert but I believe we want these to be const?
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.
If they can be declared as constants, it's definitely preferable.
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.
there is one service that is overriding the prometheusbp.DefaultLatencyBuckets. maybe remove the Default prefix if these are not intended to be overridden directly.
konradreiche
left a comment
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.
Looks good to me. What would it look like to test those changes in an existing or new Go test?
|
|
||
| import "time" | ||
|
|
||
| const ( |
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.
If they can be declared as constants, it's definitely preferable.
|
|
||
| import "time" | ||
|
|
||
| const ( |
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.
there is one service that is overriding the prometheusbp.DefaultLatencyBuckets. maybe remove the Default prefix if these are not intended to be overridden directly.
b1d7c95 to
5bf74f1
Compare
Add support for native histograms using the following settings: - NativeHistogramBucketFactor: 1.1 - NativeHistogramMaxBucketNumber: 160 - NativeHistogramMinResetDuration: 1h
6c05835 to
86ba4be
Compare
86ba4be to
dd13d98
Compare
kylelemons
left a comment
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.
Looks good to me, but def make sure to sync with the Baseplate team before merging
|
|
||
| // DefaultNativeHistogramMinResetDuration is the default minimum duration between | ||
| // resets for native histograms. | ||
| DefaultNativeHistogramMinResetDuration = time.Hour |
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.
🔕 (nit) I like to treat the constants as units that always need a coefficient for readability:
| DefaultNativeHistogramMinResetDuration = time.Hour | |
| DefaultNativeHistogramMinResetDuration = 1 * time.Hour |
💸 TL;DR
Add support for native histograms using the following settings:
Jira
This changes means that all histograms defined in baseplate.go will now be scraped as native histograms if the service is scraped using the
PrometheusProtoprotocol. This also requires the resulting prometheus instance to be configured to accept native histograms.If the service is scraped using plantext (the default), then the existing classic histograms will be scraped and this change doesn't change anything for the resulting metrics.
NB:
🧪 Testing Steps / Validation
Ran in snoodev, made sure that when namespace was configured to scrape native histograms, native histograms would show up, and classic histograms would still appear if prometheus was not configured to scrape native histograms.
✅ Checks