-
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
[exporter/otlphttpexporter] Remove unnecessary nil assignment in default client config #11299
Merged
bogdandrutu
merged 4 commits into
open-telemetry:main
from
mackjmr:mackjmr/defaultconfig-otlphttpexporter
Oct 2, 2024
Merged
[exporter/otlphttpexporter] Remove unnecessary nil assignment in default client config #11299
bogdandrutu
merged 4 commits into
open-telemetry:main
from
mackjmr:mackjmr/defaultconfig-otlphttpexporter
Oct 2, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ult client config This is a follow up to open-telemetry#11273. Although I set fields MaxIdleConns, MaxIdleConnsPerHost, MaxConnsPerHost, IdleConnTimeout to nil manually to keep backwards compatibility, it turns out that in the call to [ToClient](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confighttp/confighttp.go#L141-L166) the http.Transport defaults are used. Thus, not setting to nil will maintain the same behaviour and is not necessary.
songy23
approved these changes
Sep 30, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11299 +/- ##
==========================================
- Coverage 91.52% 91.50% -0.03%
==========================================
Files 424 430 +6
Lines 20222 20205 -17
==========================================
- Hits 18509 18489 -20
- Misses 1329 1341 +12
+ Partials 384 375 -9 ☔ View full report in Codecov by Sentry. |
bogdandrutu
reviewed
Sep 30, 2024
bogdandrutu
reviewed
Oct 1, 2024
mackjmr
added a commit
to mackjmr/opentelemetry-collector-contrib
that referenced
this pull request
Oct 3, 2024
This is a follow up to: open-telemetry#35518. Don't rely on global DefaultTransport, instead create own variable. This is based on feedback from: open-telemetry/opentelemetry-collector#11299 (comment).
jackgopack4
pushed a commit
to jackgopack4/opentelemetry-collector
that referenced
this pull request
Oct 8, 2024
…ult client config (open-telemetry#11299) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This is a follow up to open-telemetry#11273 in which I had set fields `MaxIdleConns`, `MaxIdleConnsPerHost`, `MaxConnsPerHost`, `IdleConnTimeout` to nil manually to keep backwards compatibility. However, in the call to [ToClient](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confighttp/confighttp.go#L141-L166) the `http.Transport` defaults are used. The call to `NewDefaultClientConfig` also uses the `http.Transport` defaults. Thus, not setting to nil will maintain the same behaviour/ is unnecessary. <!-- Issue number if applicable --> #### Link to tracking issue Fixes # <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.-->
HongChenTW
pushed a commit
to HongChenTW/opentelemetry-collector
that referenced
this pull request
Dec 19, 2024
…ult client config (open-telemetry#11299) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This is a follow up to open-telemetry#11273 in which I had set fields `MaxIdleConns`, `MaxIdleConnsPerHost`, `MaxConnsPerHost`, `IdleConnTimeout` to nil manually to keep backwards compatibility. However, in the call to [ToClient](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confighttp/confighttp.go#L141-L166) the `http.Transport` defaults are used. The call to `NewDefaultClientConfig` also uses the `http.Transport` defaults. Thus, not setting to nil will maintain the same behaviour/ is unnecessary. <!-- Issue number if applicable --> #### Link to tracking issue Fixes # <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a follow up to #11273 in which I had set fields
MaxIdleConns
,MaxIdleConnsPerHost
,MaxConnsPerHost
,IdleConnTimeout
to nil manually to keep backwards compatibility.However, in the call to ToClient the
http.Transport
defaults are used. The call toNewDefaultClientConfig
also uses thehttp.Transport
defaults.Thus, not setting to nil will maintain the same behaviour/ is unnecessary.
Link to tracking issue
Fixes #
Testing
Documentation