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

chore: remove redundant config Validate call #35199

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

rogercoll
Copy link
Contributor

Description:

Configuration validation is done during collector's startup, making it redundant when being called inside component's logic. This PR removes the Validate call done during exporter's constructor.

Link to tracking Issue: #33498

Testing: Same coverage after removed lines: coverage: 77.8% of statements

TestFactory_CreateLogsExporter_Fail and TestFactory_CreateTracesExporter_Fail functions are covered by the already available config_test.go cases.

Documentation:

@rogercoll rogercoll requested review from a team and crobert-1 September 16, 2024 08:37
@rogercoll
Copy link
Contributor Author

Skip changelog?

@mx-psi mx-psi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Sep 16, 2024
@mx-psi mx-psi merged commit e5e9e87 into open-telemetry:main Sep 16, 2024
162 of 164 checks passed
@rogercoll rogercoll deleted the remove_uneeded_validate branch September 17, 2024 05:49
jriguera pushed a commit to springernature/opentelemetry-collector-contrib that referenced this pull request Oct 4, 2024
**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.-->
Configuration validation is done during collector's startup, making it
redundant when being called inside component's logic. This PR removes
the Validate call done during exporter's constructor.

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

**Testing:** <Describe what testing was performed and which tests were
added.> Same coverage after removed lines: `coverage: 77.8% of
statements`

`TestFactory_CreateLogsExporter_Fail` and
`TestFactory_CreateTracesExporter_Fail` functions are covered by the
already available `config_test.go` cases.

**Documentation:** <Describe the documentation added.>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/elasticsearch Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants