Skip to content
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

Conversation

mackjmr
Copy link
Member

@mackjmr mackjmr commented Sep 30, 2024

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 to NewDefaultClientConfig also uses the http.Transport defaults.

Thus, not setting to nil will maintain the same behaviour/ is unnecessary.

Link to tracking issue

Fixes #

Testing

Documentation

…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.
@mackjmr mackjmr requested a review from a team as a code owner September 30, 2024 13:57
@mackjmr mackjmr requested a review from songy23 September 30, 2024 13:57
@songy23 songy23 added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Sep 30, 2024
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.50%. Comparing base (431fd11) to head (aa03d76).
Report is 36 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@songy23 songy23 requested a review from bogdandrutu October 1, 2024 15:03
@bogdandrutu bogdandrutu merged commit 69ff46b into open-telemetry:main Oct 2, 2024
49 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 2, 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
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants