You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
There is currently no way to easily instantiate extensions across multiple configuration sources. The default behavior in koanf is to overwrite slices when merging multiple maps. This results in behavior where the service.extensions key will be overridden and take the value of the final source if it is set multiple times.
Describe the solution you'd like
At a minimum, provide a naming scheme similar to what we provide for pipelines to allow config sources to instantiate extensions they define. This could look like:
A more comprehensive solution could be to override the default koanf merging strategy to support merging slices. I would propose the following rules for merging slices:
Slices values are not deduplicated
Slices are merged by appending slices to previous values.
The caveat with changing this behavior is that it would be more difficult to set slice values to empty lists, which would now require setting to nil (or another primitive value) before setting them to an empty list.
We could also simply recommend that extensions are all instantiated in a single file, but in my view this is not a good solution.
Additional context
It's possible I've missed an existing mechanism for this, but I've looked through the code and docs and don't see an any way to accomplish this. If I've missed something we should make it more visible.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
There is currently no way to easily instantiate extensions across multiple configuration sources. The default behavior in koanf is to overwrite slices when merging multiple maps. This results in behavior where the
service.extensions
key will be overridden and take the value of the final source if it is set multiple times.Take the following two configuration files:
If I start the Collector with the following, only the zpages extension will be started.
The effective config will look like:
Describe the solution you'd like
At a minimum, provide a naming scheme similar to what we provide for pipelines to allow config sources to instantiate extensions they define. This could look like:
Describe alternatives you've considered
A more comprehensive solution could be to override the default koanf merging strategy to support merging slices. I would propose the following rules for merging slices:
The caveat with changing this behavior is that it would be more difficult to set slice values to empty lists, which would now require setting to
nil
(or another primitive value) before setting them to an empty list.We could also simply recommend that extensions are all instantiated in a single file, but in my view this is not a good solution.
Additional context
It's possible I've missed an existing mechanism for this, but I've looked through the code and docs and don't see an any way to accomplish this. If I've missed something we should make it more visible.
The text was updated successfully, but these errors were encountered: