[RW]: Adopt client_golang/exp/api/remote types for receiving RW1 and RW2#17197
[RW]: Adopt client_golang/exp/api/remote types for receiving RW1 and RW2#17197bwplotka merged 9 commits intoprometheus:mainfrom
Conversation
|
Thanks for this. I guess @bwplotka should take a look. The |
|
Hi @bboreham, thanks for check out my PR. I think @bwplotka has already explained this quite carefully here. You can check it out: #16086 (comment) |
saswatamcode
left a comment
There was a problem hiding this comment.
LGTM! Great work 💪🏻
Some small nits!
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com> # Conflicts: # storage/remote/write_handler.go
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
dbf9b5e to
64a7843
Compare
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
5adabdf to
85a0734
Compare
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
|
cc @bwplotka |
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
bwplotka
left a comment
There was a problem hiding this comment.
Initial look - looks great! Some small comments, thanks!
bwplotka
left a comment
There was a problem hiding this comment.
Checked the rest, generally LGTM, modulo above comments, great work! 💪🏽
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
bwplotka
left a comment
There was a problem hiding this comment.
LGTM, thanks!
Before merging, let's ensure (wait for response) @bboreham is still objecting this change after our explanation, also pinged on prometheus-dev https://cloud-native.slack.com/archives/C01AUBA4PFE/p1759757051305119
|
In regard to "experimental", I would prefer if the comment was modified to say something different to "The module may be contain breaking changes or be removed in the future." |
|
Can you clarify the title "Use client_golang_exp/api/remote for handling remote writes" please? EDIT: according to a Slack comment, this PR is for receiving, and sending will be changed later. |
|
Is RW2 covered by PromBench? |
|
Great points, do you mind @pipiland2612 helping with
Yes (prometheus/test-infra#845) -- although for sending, which we don't change here. We don't have prombench for receiving for anything AFAIK |
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
Hi @bboreham, Indeed, thanks for suggesting. I have updated the PR title and descriptions |
Thanks! Making changes at https://github.com/prometheus/client_golang/pull/1894/files. PTAL |
|
Thanks, the scope and impact is much clearer now. |
|
I changed title and squashed commit msg to include "receiving" word, otherwise it looks like we adopt this lib for all RW interactions in this PR. Next time, please ensure clear PR titles and descriptions, it's quite important. @pipiland2612 (: |
## Summary This PR upgrades the `github.com/prometheus/prometheus` dependency from v0.307.3 to v0.308.0. ## Changes Made #### Fixed `RemoteWriteProtoMsg` unrecognized In prometheus/prometheus v0.308.0, the remote write protocol message types were moved from `github.com/prometheus/prometheus/config` to `github.com/prometheus/client_golang/exp/api/remote` as part of [prometheus/prometheus#17197](prometheus/prometheus#17197). #### Fixed `CreatedTimestamp` → `StartTimestamp` In [prometheus/prometheus#17411](prometheus/prometheus#17411), the Remote Write 2.0 spec was updated to 2.0-rc.4. The `CreatedTimestamp` field was renamed to `StartTimestamp` and moved from `TimeSeries` to individual `Sample` and `Histogram` messages. #### Fixed not enough arguments in`api_v1.NewAPI` The `api_v1.NewAPI` function signature changed due to [prometheus/prometheus#17470](prometheus/prometheus#17470) - Added `appendMetadata bool` parameter for remote write metadata handling. Added the new parameter `appendMetadata = false` - prometheusreceiver scrapes targets, doesn't receive remote write requests ## Remaining Issues ### `EnableNativeHistogramsIngestion` removed from `scrape.Options` There's one change in this upgrade that I'd love to get the community's input on before finalizing. In [prometheus/prometheus#17315](prometheus/prometheus#17315), Prometheus removed the `EnableNativeHistogramsIngestion` field from `scrape.Options`. Native histogram ingestion is now controlled through the Prometheus scrape config option `scrape_native_histograms` rather than programmatically. This creates an interesting situation for us. Currently, we have the feature gate `receiver.prometheusreceiver.EnableNativeHistograms` that controls whether native histograms are converted to OTel exponential histograms. But with this Prometheus change, the *ingestion* of native histograms during scraping is now a separate concern controlled by Prometheus config. I see two paths forward here. We could automatically inject `scrape_native_histograms: true` into the scrape config whenever our feature gate is enabled, preserving the current behavior where enabling the feature gate is all users need to do. Alternatively, we could simply remove the line and require users to configure `scrape_native_histograms: true` in their Prometheus scrape config themselves, which is more explicit but adds an extra configuration step. What do you think? I'm also wondering if this constitutes a breaking change that should be called out in the changelog. Would appreciate any thoughts! --------- Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Which issue(s) does the PR fix:
Scope
This PR migrates Prometheus to use the official
github.com/prometheus/client_golang/exp/api/remotepackage types for remote write protocol handling. This change covers:What's included:
exp/api/remotetypes for processing both RW1 (prometheus.WriteRequest) and RW2 (io.prometheus.write.v2.Request) incoming requestsexp/api/remotetypes when sending remote write requests (both RW1 and RW2)config.RemoteWriteProtoMsgwithremoteapi.WriteMessageTypethroughout the codebaseWhat's NOT included:
Does this PR introduce a user-facing change?