-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 confighttp.HTTPTransportSettings #2470
Conversation
The change introduces a HTTPTransportSettings struct, that is only used to configure an `http.Client` and `http.Transport`. The HTTPClientSettings structs embedds the HTTPTransportSettings, only adding the `endpoint` setting.
Codecov Report
@@ Coverage Diff @@
## main #2470 +/- ##
=======================================
Coverage 91.76% 91.77%
=======================================
Files 265 265
Lines 15111 15119 +8
=======================================
+ Hits 13867 13875 +8
Misses 866 866
Partials 378 378
Continue to review full report at Codecov.
|
The tests fail on open-telemetry-contrib, which is somewhat to be expected as the type of HTTPClientSettings has changed. For example:
How can we proceed from here? |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Description:
The change introduces a
HTTPTransportSettings
struct, that is only used to configure anhttp.Client
andhttp.Transport
. TheHTTPClientSettings
structs embeds theHTTPTransportSettings
, onlyadding the
endpoint
setting.The
ToClient
method is moved toHTTPTransportSettings
, as the new type retains all fields that have been used by(*HTTPClientSettings).ToClient
in the past.Separating transport settings from the
endpoint
setting encourages reuse for exporters that allow users to configure multiple endpoints. For example when working on the Elasticsearch exporter (PR) a separate struct for HTTP settings is introduced, because theendpoint
setting does not fit the exporter. Yet all other settings are copied. Still, having a common struct to share settings improves consistency among different exporters (and other settings), reducing the chance of features diverging in their capabilities.Link to tracking Issue: None
Testing: The existing tests have been adapted.
Documentation: Add
response_header_timeout
to confighttp/README.md