-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/nginx] Use NewDefaultClientConfig instead of manually creating struct #35452
Conversation
…ing struct Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
receiver/nginxreceiver/factory.go
Outdated
clientConfig.MaxIdleConns = nil | ||
clientConfig.MaxIdleConnsPerHost = nil | ||
clientConfig.MaxConnsPerHost = nil | ||
clientConfig.IdleConnTimeout = nil |
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.
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
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.
Thank's! I have updated the patch.
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
…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.>
…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.>
…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 <chrismarkou92@gmail.com>
Description:
Similar to open-telemetry/opentelemetry-collector#11273.
This PR makes usage of the
NewDefaultClientConfig
instead of manually creating theconfighttp.ClientConfig
struct as part of #35457.Link to tracking Issue: #35457
Testing:
Documentation: