-
Notifications
You must be signed in to change notification settings - Fork 76
Prometheus compatible histograms #93
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
Prometheus compatible histograms #93
Conversation
|
after a bit of reflexion, I believe it could also be possible to add a Line 48 in 704aa40
that way we could have several implementations and depending on the histogram type use e.g. compatible/ type HistogramType int
const (
VictoriaMetrics = iota // or OTLP, Static, ...
Compatible // or vmrange, log-based, VM, ...
) |
|
Hello @clementnuss! Thanks for the initiative! I think the rationale you provided, and the linked issues, all make sense. It would be beneficial for many users and for this package to support the traditional histograms with static list of buckets.
To keep things simple, I'd suggest to have it as completely separate structure. It should be simpler from API and implementation perspective. |
|
My pleasure 🙃 I will change the name and complete the implementation. which one works best?
|
cf VictoriaMetrics#28 test: add basic prometheus histogram test case
860fd75 to
d1c7648
Compare
|
the PR is ready, let me know what needs to be fixed. I wasn't sure whether I should implement the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #93 +/- ##
==========================================
+ Coverage 86.89% 87.53% +0.64%
==========================================
Files 11 12 +1
Lines 1450 1597 +147
==========================================
+ Hits 1260 1398 +138
- Misses 142 149 +7
- Partials 48 50 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f41gh7
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.
Overall looks good to me, please see few minor comments
2541bd1 to
67ff519
Compare
|
@f41gh7 reviewing the coverage I noticed I had forgotten to delete the implementation of .Merge, I had only removed the tests. this is now fixed and I force-pushed. |
hagen1778
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! See some comments
Co-authored-by: Roman Khavronenko <[email protected]>
Co-authored-by: Roman Khavronenko <[email protected]>
clementnuss
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.
did implement most of the suggestions. added a few questions as a result!
|
Thanks for your contribution @clementnuss! |
* fix typos and comment formatting for godoc * add ExponentialBuckets helper for exponential buckets, as it seems to be most popular helper in prometheus sdk * update obscure LinearBuckets test * verify that neither ExponentialBuckets nor LinearBuckets produce non-increasing buckets by enforcing `mustValidateBuckets` call * fix example tests * mention PrometheusHistogram in README
|
@clementnuss please see review updates in 95d307d |
hagen1778
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.
Thanks for the contribution @clementnuss !

as a follow-up/alternative to #45 and to solve #28, I'm starting this PR which adds support for OTLP histograms (the common
le- static bucket type of histograms, not the complex exponential histograms/native histograms).I know that VM focus is on log based buckets and really appreciate those, but having the opportunity to use "normal" histograms with this library would be greatly appreciated, as documented in #28
before working too much on this, I'd like to know whether support for normal / OTLP style buckets could be considered or not. I don't want to spend too much time on this PR if at the end @valyala @hagen1778 you decide against such a feature.
I'd also like to start a discussion on the name. I picked
OTLPHistogramin reference to the histograms described in the OpenTelemetry Protocol, but perhaps the naming is bad.[EDIT]: I think that
CompatibleHistogramwould make more sense thanOTLPHistogram, had not thought about it until after I started implementing the functionscurrently the basic functionality is implemented, and a testcase covers a simple usage. if there is a decision in favor of this PR, I will add the missing testcases and complete the implementation (add a function for custom buckets/upper bounds for example)