-
Notifications
You must be signed in to change notification settings - Fork 301
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
Introduce http client profile option for custom configuration #3165
base: main
Are you sure you want to change the base?
Conversation
ec60825
to
a6ea19e
Compare
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 like the concept!
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.
LGTM 👍
On the HTTP/2 issue, I think it might lack visibility if someone is trying to use a profile and disable it the legacy way. May be worth checking and logging or even fatal-ing?
7f050e8
to
283cc36
Compare
Better description of the valid http client profiles. Co-authored-by: Josh Deprez <[email protected]>
283cc36
to
89aeb92
Compare
@DrJosh9000 great point, the agent now reports a conflict for that particular setting.
|
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 like the idea, I have a question about if that patch has been released?
switch conf.HTTPClientProfile { | ||
case ClientProfileStdlib: | ||
// Base any modifications on the default transport. | ||
transport := http.DefaultTransport.(*http.Transport).Clone() |
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.
As far as I can tell https://go-review.googlesource.com/c/net/+/617655 is merged but not released. So using the default option would re-introduce the bug we fixed in #3005?
Description
We have customers using the agent in a number of different environments, across different cloud services all over the world, so different configuration profiles for the HTTP client would be valueble.
Context
The Go HTTP client has a log of configurable timeouts, passing all these through is not sustainable so we need a way to bless a subset of configuration and provide this with a generic name, hence the idea of configuration profiles.
On top of this different version of Go introduce new features, and new timeouts, so we also need a way to introduce new profiles as the HTTP Client evolves.
Changes
This change introduces a flag which allows us to add HTTP client configurations which allows us to provide new profiles for customers, while also providing an unconfigured standard library profile to take advantage of the current defaults.
To get the ball rolling I have created a stdlib profile which applies the absolulte minimum configuration, this includes tlsconfig overrides, and the timeout value. Disabling H2 is not provided as this is avaliable via the
GODEBUG
environment variable supported by the Go Team. https://pkg.go.dev/net/http#hdr-HTTP_2Testing
go test ./...
). Buildkite employees may check this if the pipeline has run automatically.go fmt ./...
)