-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[otelcol] update to use confmap unmarshal validation instead of invoking top-level Validate function manually. #12058
base: main
Are you sure you want to change the base?
Conversation
Just giving this a quick pass, I like that we hoisted the calls to validate the config out of the Given the PoC, what do you think about this change? |
I like utilizing I ran into an issue in the unmarshalHookFunction where I could not specify all custom unmarshal implementations to use This update allows the top-level unmarshalling to validate correctly, which means that component unmarshal implementations don't need to use The other thing I don't care for is we can no longer differentiate between errors retrieving the configuration and validating the retrieved config. When this was separate steps before we knew which step was erroring - now in order to differentiate we'd need special error types. |
It sounds like most of the downsides result from merging the unmarshaling and validation steps. What if instead of doing validation in |
We could move the |
Description
Mockup of what it could look like to use confmap validation in otelcol.
Link to tracking issue
Related to #11524
Testing
Would need actual unit test updates