Repository navigation
Unroll NHCBs to Classic Histograms func for RW - #17166
Conversation
e5b1d0c to
524e3d7
Compare
bwplotka
left a comment
There was a problem hiding this comment.
NOTEs after pair review:
- We might want to outline plan/handling for potential conflicts - this means that if there's a nhcb histogram with name
nhcbHISTOGRAM AND you set nhcbToClassic option AND you have already countersnhcb_bucketandnhcb_countandnhcb_sum(conflicts around https://prometheus.io/docs/specs/native_histograms/#scraping-both-classic-and-native-histograms). This problem will be also happening in native summaries, so perhaps you could @Naman-B-Parlecha have a dedicated section in your drafted proposal and we can iterate over ideas AND how realistic this scenario is.
For this PR, we could just allow conflicts (send duplicated series via RW) and document this behaviour. I don't think we can handle those conflicts here, they would need to be handled on TSDB Append.
- We agreed to perhaps split this PR into two/three for easier review.
ff74632 to
8d791b1
Compare
Signed-off-by: Naman-B-Parlecha <[email protected]>
8d791b1 to
c8e3f8c
Compare
Signed-off-by: Naman-B-Parlecha <[email protected]>
|
Hey!! Also, I had a question (more like a confusion)
Which i was trying to work upon. So i started using builder from the queue_manager as seen here But i was concerned about it having labels that would be important and to not disturb other parts of the codebase i thought of reset the label builder but also roll it back to original labels to maintain what it holds - reference. I was confused here whether i was doing it correctly or is there a better way of using the builder in such cases? WDYT?? cc: @bwplotka |
|
Hey @perebaj the PR is read for another round of review!! |
e3f3881 to
745ce65
Compare
Signed-off-by: Naman-B-Parlecha <[email protected]>
745ce65 to
73904b4
Compare
Signed-off-by: Naman-B-Parlecha <[email protected]>
ff76264 to
f71f911
Compare
perebaj
left a comment
There was a problem hiding this comment.
suggesting removing some comments and improve the name of tests structures
… tests Signed-off-by: Naman-B-Parlecha <[email protected]>
|
@bwplotka @perebaj On enabling And if there still is conflicts when unrolling, we can just error out? |
|
Looks good in general, we decided to discuss the conflict topic in a native summaries proposal, but for nhcb unrolling it will be relevant for another PR (the one that uses this function in RW). I will review this PR closer in the incoming days (likely Monday) unless @perebaj will review sooner 👍🏽 |
bwplotka
left a comment
There was a problem hiding this comment.
Looks great! Some suggestions for higher reliability of this code and test, but otherwise great job 💪🏽
Signed-off-by: Naman-B-Parlecha <[email protected]>
Signed-off-by: Naman-B-Parlecha <[email protected]>
Signed-off-by: Naman-B-Parlecha <[email protected]>
bwplotka
left a comment
There was a problem hiding this comment.
LGTM, just tiny nits, @krajorama @bboreham are you ok with adding float formatting to labels pkg? It's essentially related to le label, so I'd think it's not a bad spot (although type and unit label semantics are in /schema/package), WDYT?
Signed-off-by: Naman-B-Parlecha <[email protected]>
krajorama
left a comment
There was a problem hiding this comment.
Hi, thanks for starting to work on this.
I think there's some nuances about the model missed in the implementation. I've added comments.
Also I would advise you to set up a testbed with some target + Prometheus -> remote write -> other Prometheus and test things end-to-end.
You should get the same result whether you're using NHCB or not.
454c581 to
4e2082f
Compare
Signed-off-by: Naman-B-Parlecha <[email protected]>
4e2082f to
1df1f53
Compare
|
Hey @krajorama, And tried to implement the same, will setup a testbed in some time and add the results here |
|
Hey @krajorama here are the testbed results
|
|
Hey @bwplotka @krajorama, i have refactored the PR to support sparseness in NHCBs and have addressed all the changes suggested. |
krajorama
left a comment
There was a problem hiding this comment.
Almost there, a few more details commented.
Sorry about the long wait, but we were very busy with Prometheus conference last week.
|
Hey @krajorama, I have addressed all the comments PTAL, have added |
7cda72e to
acca16d
Compare
Signed-off-by: Naman-B-Parlecha <[email protected]>
acca16d to
f14c515
Compare
There was a problem hiding this comment.
LGTM
I don't want to delay this PR anymore, but we should move the code to https://github.com/prometheus/prometheus/tree/main/util/convertnhcb in a next PR.
Also technically you can do the conversion without allocating the intermediate positiveBuckets array.




Which issue(s) does the PR fix:
Does this PR introduce a user-facing change?
Implements conversion from Native Histogram Custom Buckets (NHCB) to classic histogram format for Remote Write compatibility and migration scenario
The PR consists of func that handles the conversion of Histograms
convert_nhcb_to_classic#17205