-
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
[confmap] - new command line argument for append merging strategy #12097
base: main
Are you sure you want to change the base?
[confmap] - new command line argument for append merging strategy #12097
Conversation
3ac6d58
to
9059b29
Compare
@Aneurysm9 @evan-bradley @mx-psi can you take another look? i've removed feature flag and added command line argument to control the paths user wants merged. I'll work on the documentation once we've established a common ground. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12097 +/- ##
==========================================
+ Coverage 91.84% 91.87% +0.02%
==========================================
Files 465 466 +1
Lines 25325 25442 +117
==========================================
+ Hits 23261 23375 +114
- Misses 1675 1677 +2
- Partials 389 390 +1 ☔ View full report in Codecov by Sentry. |
7b5fe09
to
5685baa
Compare
Koanf's default merging strategy currently overrides static values such as slices, numbers, and strings. However, lists of components should be treated as a special case. This pull request introduces a new feature gate to allow for merging lists instead of discarding the existing ones.
With this new merging strategy:
service
configuration are merged rather than replaced.service::*
.Link to tracking issue
Related issues:
Testing
Documentation
Usage Examples
otelcol --config config1.yaml --config config2.yaml --merge-paths-append "service"
service
path in the config.otelcol --config config1.yaml --config config2.yaml --merge-paths-append "processor::transform::log_statements"
processor::transform::log_statements
path in the config. It will not affect any other config paths.otelcol --config config1.yaml --config config2.yaml --merge-paths-append "*"
otelcol --config config1.yaml --config config2.yaml --merge-paths-append "processor::transform::log_statements" --merge-paths-append "service"
For backward compatibly, the default behaviour is not to merge lists. Users who want to explicitly merge lists can enable the command line option.
Note: I’d appreciate your feedback on this 🙏