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

[receiver/nginx] Use NewDefaultClientConfig instead of manually creating struct #35452

Merged

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Sep 27, 2024

Description:

Similar to open-telemetry/opentelemetry-collector#11273.
This PR makes usage of the NewDefaultClientConfig instead of manually creating the confighttp.ClientConfig struct as part of #35457.

Link to tracking Issue: #35457

Testing:

Documentation:

@ChrsMark ChrsMark requested review from djaglowski and a team as code owners September 27, 2024 10:10
@ChrsMark ChrsMark added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Sep 27, 2024
clientConfig.MaxIdleConns = nil
clientConfig.MaxIdleConnsPerHost = nil
clientConfig.MaxConnsPerHost = nil
clientConfig.IdleConnTimeout = nil
Copy link
Member

@mackjmr mackjmr Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	clientConfig.MaxIdleConns = nil
	clientConfig.MaxIdleConnsPerHost = nil
	clientConfig.MaxConnsPerHost = nil
	clientConfig.IdleConnTimeout = nil

This part can be deleted, for MaxIdleConns, MaxIdleConnsPerHost, MaxConnsPerHost, IdleConnTimeout even if you set to nil here, the same defaults end up being used in the call to ToClient: https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confighttp/confighttp.go#L136.

Note you may need to update some tests similarly to: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/35518/files#diff-f1add4d95d0ec4f45889d7b60c61a9a274ab2f22f5013b9063a6b1baddd660e3R82

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank's! I have updated the patch.

djaglowski pushed a commit that referenced this pull request Oct 9, 2024
…f manual initialization (#35509)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

Similar to
#35452
but for the `elasticsearch` receiver.

**Link to tracking Issue:** <Issue number if applicable>
#35457

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>
@djaglowski djaglowski merged commit 27aa54b into open-telemetry:main Oct 9, 2024
155 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 9, 2024
jmichalek132 pushed a commit to jmichalek132/opentelemetry-collector-contrib that referenced this pull request Oct 10, 2024
…f manual initialization (open-telemetry#35509)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

Similar to
open-telemetry#35452
but for the `elasticsearch` receiver.

**Link to tracking Issue:** <Issue number if applicable>
open-telemetry#35457

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>
jmichalek132 pushed a commit to jmichalek132/opentelemetry-collector-contrib that referenced this pull request Oct 10, 2024
…ing struct (open-telemetry#35452)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Similar to
open-telemetry/opentelemetry-collector#11273.
This PR makes usage of the `NewDefaultClientConfig` instead of manually
creating the `confighttp.ClientConfig` struct as part of
open-telemetry#35457.

**Link to tracking Issue:** <Issue number if applicable>
open-telemetry#35457

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>

---------

Signed-off-by: ChrsMark <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
receiver/nginx Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants