-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Move remote write API to client_golang/exp #1711
base: prwclient-em
Are you sure you want to change the base?
Conversation
Signed-off-by: Saswata Mukherjee <[email protected]>
I would straight away try to avoid old client shenigans and rethink this from scratch. |
Signed-off-by: Saswata Mukherjee <[email protected]>
baseURL *url.URL | ||
client *http.Client |
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.
Passing http.Client directly here instead of api.Client structs. Seems like the most flexible way, without doing custom configs.
// SnappyDecompressorMiddleware returns a middleware that checks if the request body is snappy-encoded and decompresses it. | ||
// If the request body is not snappy-encoded, it returns an error. | ||
// Used by default in NewRemoteWriteHandler. | ||
func SnappyDecompressorMiddleware(logger *slog.Logger) func(http.Handler) http.Handler { |
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.
Tried to convert this into a middleware with the ability for downstream users to override and add their own middlewares if needed.
Let me know what you think, or if this is too much
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Can we create a go mod file? It has to be a separate Go module if it will be experimental. |
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.
Looking good.
We need documentation:
- We need a README. And we need to make the intention crystal clear.
- Also, we have to be clear, we don't give any guarantees that the experimental APIs won't introduce breaking changes, or they will eventually be promoted to stable.
- How do we release? This suppose to have different release cycles and maybe tags.
Additionally, we need experiment owners. So that we can ping them on the issues. |
Signed-off-by: Saswata Mukherjee <[email protected]>
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.
Added a workspace file as well
Yup, probably some example usage helps
exp package go doc has a line on this, but yes probably something to mention in dedicated README. Might be good to do this in next PR to prwclient-em branch? |
Moving to exp.
Do we want to create new client in this remote write API addition as well? Or do future iteration on it? :)
I might add the decompression middleware stuff here as well
cc: @bwplotka