Add missing ObjectProvider for missing beans
Update `MetricsAutoConfiguration` to use an `ObjectProvider` to guard against missing beans. See gh-9970
This commit is contained in:
parent
ddca0b7422
commit
21b645fba8
|
|
@ -114,10 +114,12 @@ public class MetricsAutoConfiguration {
|
|||
|
||||
MeterRegistryConfigurationSupport(MeterRegistry registry,
|
||||
ObjectProvider<Collection<MeterRegistryConfigurer>> configurers,
|
||||
MetricsProperties config, Collection<MeterBinder> binders) {
|
||||
MetricsProperties config,
|
||||
ObjectProvider<Collection<MeterBinder>> binders) {
|
||||
configurers.getIfAvailable(Collections::emptyList)
|
||||
.forEach((configurer) -> configurer.configureRegistry(registry));
|
||||
binders.forEach((binder) -> binder.bindTo(registry));
|
||||
binders.getIfAvailable(Collections::emptyList)
|
||||
.forEach((binder) -> binder.bindTo(registry));
|
||||
if (config.isUseGlobalRegistry()) {
|
||||
Metrics.addRegistry(registry);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue