Improve AbstractHealthAggregator to allow customization of aggregated details #4674
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.
ATM
AbstractHealthAggregator
allows customization of how aggregated status is calculated, but does not allow users to specify their own representation of aggregated details. And due toaggregate
method being declared asfinal
there is no elegant way of making such customization.This PR adds
abstract
method to allow the subclasses to define how aggregated details are constructed.Motivation:
In our current project we integrate with a proprietary external system. To monitor the connection(s) to this system we have implemented custom
HealthIndicator
. Usually there are multiple instances of this system, with number of instances being determined in runtime. To represent the health of connection we useCompositeHealthIndicator
which is composed of multiple instances of our customHealthIndicator
which, by default (OrderedHealthAggregator
is being used), results in the following health output:However, due to dynamic nature of number of nested
HealthIndicator
s the desired representation of details would be an array:I've signed the CLA.