-
Notifications
You must be signed in to change notification settings - Fork 659
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
feat(schemaregistry): allow custom http client #1030
feat(schemaregistry): allow custom http client #1030
Conversation
This patch introduces the ability to set a custom base http client. Common use cases include using traced http clients from telemetry providers.
} | ||
|
||
client.Transport = transport | ||
client.Timeout = time.Duration(timeout) * time.Millisecond |
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.
I wonder if the "old" config should be deprecated. Also, it might make sense to check if the client has any existing timeout and use that instead if so.
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.
I think this makes sense, but I'm hesitant to do it as part of this PR. That is more of a design change rather than a feature to enable us the ability to start using our own HTTP client. Right now the schemaregistry.Config struct is mostly an opinionated abstraction over how an http.Client is configured, and I think I want to retain that intent through this work.
If later, it's desired to allow users to more explicitly set an http.Client and all it's settings, then that work should encompass everything from the TLS, timeout and any other settings currently exposed through schemaregistry.Config.
This is a requirement for proper observability, but context propagation would also be necessary (ie. add a |
Good point. I'm leaning towards a version bump and just introducing ctx rather than |
Subsumed by #1099 |
This patch introduces the ability to set a custom base http client that will be used for the rest calls to the Schema Registry.
Common use cases include using traced http clients from telemetry providers. (This may be a viable solution for #712)