-
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
Add ConfigUnmarshaler interface to allow mutations on the parsed Config #3706
Conversation
Build failed somewhere in config tests, not sure if related to the change. |
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.
When I first read the name ConfigLoader I thought that it was related to load the configuration file. The "loader" unmarshall a config parser into a service configuration. Perhaps the name should be something around config builder or unmarshall, load sounds to me more about "loading" the configuration into the parser.
@pjanotti good feedback, will update the PR. |
0d63e98
to
d09d696
Compare
4d26981
to
1ea3760
Compare
e2ad4e9
to
6f2c469
Compare
@tigrannajaryan @jrcamp @dmitryax can one of you approve this? |
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.
Approved. Looking forward to see docs in a future PR.
My 2p here: I think this PR addresses #3023 in a unexpected way, if someone wants to apply some changes over config object then they need to implement the I wonder if there are actual use cases where For our use case we patched the collector with this approach (not saying this is the best but it looks very explicit: hypertrace@7c9197e). |
Signed-off-by: Bogdan Drutu <[email protected]>
6f2c469
to
92ab6bb
Compare
@jcchavezs I think even though this may not seem as intuitive, this design choice gives us the best of both worlds. The reason is because it is generic enough to allow us to change the unmarshalling logic as well as being able to change the generated config. I do understand your concern, but I would say that your proposal is very focused on your use-case, and may be too specific, so instead I believe that going with a more generic approach like this allows us to extend in the future everything that we need. There may be implementations that need to use other structure tags, or that may override some values, etc. Also the chaining proposed has the same problem of ordering as you pointed if using this interface, because it is not guaranteed that the "config processors" will be configured in the expected order (similar issues). This proposal also avoids adding new concepts like "config processors" so I think in some ways it is simpler. |
Fixes #3023
Signed-off-by: Bogdan Drutu [email protected]