-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[component] Allow calling component.ValidateConfig
at the top level
#12102
Merged
mx-psi
merged 1 commit into
open-telemetry:main
from
evan-bradley:toplevel-component-validateconfig
Jan 23, 2025
Merged
[component] Allow calling component.ValidateConfig
at the top level
#12102
mx-psi
merged 1 commit into
open-telemetry:main
from
evan-bradley:toplevel-component-validateconfig
Jan 23, 2025
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12102 +/- ##
=======================================
Coverage 91.60% 91.60%
=======================================
Files 461 461
Lines 24678 24678
=======================================
Hits 22607 22607
Misses 1689 1689
Partials 382 382 ☔ View full report in Codecov by Sentry. |
7c704fa
to
c53dbe7
Compare
I'm skipping the contrib tests for now, I'll fix any errors with an |
mx-psi
approved these changes
Jan 20, 2025
jade-guiton-dd
approved these changes
Jan 21, 2025
TylerHelmuth
approved these changes
Jan 21, 2025
Merged
via the queue into
open-telemetry:main
with commit Jan 23, 2025
24f88da
67 of 68 checks passed
sincejune
added a commit
to sincejune/opentelemetry-collector
that referenced
this pull request
Jan 24, 2025
…op level (open-telemetry#12102)" This reverts commit 24f88da.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 31, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Follow up to #12102. This prints the full path to where the error occurred in a config object using available reflection metadata. Currently some paths will be duplicated until we shift otelcol to call `component.ValidateConfig` on `otelcol.Config` and remove manual calls to `Validate`, but no information will be missing. If this is a concern we can do both steps at once. Example error messages: ``` collector server run finished with error: invalid configuration: receivers::otlp: must specify at least one protocol when using the OTLP receiver service::telemetry: collector telemetry metrics reader should exist when metric level is not None, level is Normal ``` I'll clean this PR up once #12102 is merged, but you can see the latest commit for the changes relevant to only this PR. --------- Co-authored-by: Evan Bradley <evan-bradley@users.noreply.github.com> Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
sfc-gh-sili
pushed a commit
to sfc-gh-sili/opentelemetry-collector
that referenced
this pull request
Feb 3, 2025
…2108) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Follow up to open-telemetry#12102. This prints the full path to where the error occurred in a config object using available reflection metadata. Currently some paths will be duplicated until we shift otelcol to call `component.ValidateConfig` on `otelcol.Config` and remove manual calls to `Validate`, but no information will be missing. If this is a concern we can do both steps at once. Example error messages: ``` collector server run finished with error: invalid configuration: receivers::otlp: must specify at least one protocol when using the OTLP receiver service::telemetry: collector telemetry metrics reader should exist when metric level is not None, level is Normal ``` I'll clean this PR up once open-telemetry#12102 is merged, but you can see the latest commit for the changes relevant to only this PR. --------- Co-authored-by: Evan Bradley <evan-bradley@users.noreply.github.com> Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com> Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
Updates
component.ValidateConfig
to recurse through the entire config object by checking forConfigValidator
implementations of structs that are under interfaces. Right nowValidateConfig
stops at things likecomponent.Config
which themselves can't implementcomponent.ValidateConfig
becausecallValidateIfPossible
can only see the interface and not the concrete type before this change.Link to tracking issue
Replaces #12058.
Works toward #11524.