-
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
chore: use default confighttp struct for tests #36681
Merged
djaglowski
merged 3 commits into
open-telemetry:main
from
rogercoll:extensible_confighttp_init
Dec 6, 2024
Merged
chore: use default confighttp struct for tests #36681
djaglowski
merged 3 commits into
open-telemetry:main
from
rogercoll:extensible_confighttp_init
Dec 6, 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
Skip changelog? |
atoulme
approved these changes
Dec 6, 2024
ZenoCC-Peng
pushed a commit
to ZenoCC-Peng/opentelemetry-collector-contrib
that referenced
this pull request
Dec 6, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description These components are constructing `confighttp.ClientConfig` field by field and adding the corresponding defaults. Instead of using default values to construct a new struct, the new struct should already contain the defaults. This becomes an issue when adding new fields with defaults in the `ClientConfig` structure, see: open-telemetry/opentelemetry-collector#10877 Error in the core collector CI: ``` === FAIL: . TestLoadConfig/elasticsearch (re-run 1) (0.00s) config_test.go:200: Config mismatch (-expected +actual): &elasticsearchreceiver.Config{ ControllerConfig: {CollectionInterval: s"2m0s", InitialDelay: s"1s"}, ClientConfig: confighttp.ClientConfig{ ... // 15 identical fields HTTP2PingTimeout: s"0s", Cookies: nil, - MaxRedirects: 0, + MaxRedirects: 10, }, MetricsBuilderConfig: {Metrics: {ElasticsearchBreakerMemoryEstimated: {Enabled: true}, ElasticsearchBreakerMemoryLimit: {Enabled: true}, ElasticsearchBreakerTripped: {Enabled: true}, ElasticsearchClusterDataNodes: {Enabled: true}, ...}, ResourceAttributes: {ElasticsearchClusterName: {Enabled: true}, ElasticsearchIndexName: {Enabled: true}, ElasticsearchNodeName: {Enabled: true}, ElasticsearchNodeVersion: {Enabled: true}}}, Nodes: {"_local"}, ... // 4 identical fields } ``` <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, 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.-->
sbylica-splunk
pushed a commit
to sbylica-splunk/opentelemetry-collector-contrib
that referenced
this pull request
Dec 17, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description These components are constructing `confighttp.ClientConfig` field by field and adding the corresponding defaults. Instead of using default values to construct a new struct, the new struct should already contain the defaults. This becomes an issue when adding new fields with defaults in the `ClientConfig` structure, see: open-telemetry/opentelemetry-collector#10877 Error in the core collector CI: ``` === FAIL: . TestLoadConfig/elasticsearch (re-run 1) (0.00s) config_test.go:200: Config mismatch (-expected +actual): &elasticsearchreceiver.Config{ ControllerConfig: {CollectionInterval: s"2m0s", InitialDelay: s"1s"}, ClientConfig: confighttp.ClientConfig{ ... // 15 identical fields HTTP2PingTimeout: s"0s", Cookies: nil, - MaxRedirects: 0, + MaxRedirects: 10, }, MetricsBuilderConfig: {Metrics: {ElasticsearchBreakerMemoryEstimated: {Enabled: true}, ElasticsearchBreakerMemoryLimit: {Enabled: true}, ElasticsearchBreakerTripped: {Enabled: true}, ElasticsearchClusterDataNodes: {Enabled: true}, ...}, ResourceAttributes: {ElasticsearchClusterName: {Enabled: true}, ElasticsearchIndexName: {Enabled: true}, ElasticsearchNodeName: {Enabled: true}, ElasticsearchNodeVersion: {Enabled: true}}}, Nodes: {"_local"}, ... // 4 identical fields } ``` <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, 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
exporter/alertmanager
receiver/elasticsearch
Skip Changelog
PRs that do not require a CHANGELOG.md entry
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
These components are constructing
confighttp.ClientConfig
field by field and adding the corresponding defaults. Instead of using default values to construct a new struct, the new struct should already contain the defaults.This becomes an issue when adding new fields with defaults in the
ClientConfig
structure, see: open-telemetry/opentelemetry-collector#10877Error in the core collector CI:
Link to tracking issue
Fixes
Testing
Documentation