Skip to content
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

Support remote write v2 by converting request #6330

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SungJin1212
Copy link
Contributor

@SungJin1212 SungJin1212 commented Nov 11, 2024

This PR supports Prometheus remote write 2.0 by converting the v2 request to v1 at the API.

Which issue(s) this PR fixes:
Fixes #6324

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@SungJin1212 SungJin1212 force-pushed the Add-remote-write-v2-api branch 5 times, most recently from 3cfef0e to 07bbbee Compare November 11, 2024 09:23
@yeya24
Copy link
Contributor

yeya24 commented Nov 14, 2024

Looks promising. Thanks!

FYI we have prometheus/client_golang#1658 which exports remote write handler. Not a blocker for this PR but we should keep it on our radar to switch to use the library

@SungJin1212
Copy link
Contributor Author

@yeya24
Thanks for letting me know.
Should we make the issue to track it?

@alanprot
Copy link
Member

Maybe we can open a issue for someone give a try to use the client_golang handler even before it get merged so we can give feedback on the open PR. Changing that handler after is merged probably will be more difficult as it could potentially break all projects that are already using it.

@SungJin1212
Copy link
Contributor Author

@alanprot
I added a comment here: #6324

@yeya24
Copy link
Contributor

yeya24 commented Nov 17, 2024

I took a breif look at prometheus/client_golang#1658. Left some comments there and we have some changes Cortex specific that might not make sense for Prometheus. I think we are ok to proceed with this PR first.

@SungJin1212
Copy link
Contributor Author

@yeya24
Thanks. I read it, and it would be good if we could reuse its functions!

}
case config.RemoteWriteProtoMsgV2:
var req writev2.Request
err := util.ParseProtoReader(ctx, r.Body, int(r.ContentLength), maxRecvMsgSize, &req, util.RawSnappy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alanprot @danielblando
I wonder if we want to introduce a feature flag to control the behavior for RW v2 request. We can either ignore the request or convert to v1 and in the future maybe just accept as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus Remote Write v2 Implementation
3 participants