4.x Fix nested config prefix for observer settings #8010
Merged
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
Resolves #8009
The metrics and health CDI extension constructors passed the incorrect config key for nested (non-top-level) config settings.
The original code passed
observe.providers.metrics
andobserve.providers.health
. I suspect this was correct before the restructuring of features and observers, and their config now appears underserver.features.observe.observers.metrics
and...health
instead and useobservers
instead ofproviders
in the prefix. I further suspect these strings just fell through the cracks during the refactoring.This PR adds a superclass method which computes the correct prefix (so the hard-coded part of the prefix is in one place) and adjusts the constructors to invoke it.
Note that the superconstructor accepts a list of config prefixes, and the leaf constructors pass both the above correct prefixes and the old (3.x) top-level prefixes (
metrics
andhealth
).Documentation
Bug fix - no doc impact.