diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfiguration.java index 432aaab2d17..3f8234e8d11 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfiguration.java @@ -18,7 +18,6 @@ package org.springframework.boot.actuate.autoconfigure.metrics.cache; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Configuration; @@ -33,7 +32,6 @@ import org.springframework.context.annotation.Import; @Configuration @ConditionalOnBean(CacheManager.class) @ConditionalOnProperty(value = "management.metrics.cache.instrument", matchIfMissing = true) -@EnableConfigurationProperties(CacheMetricsProperties.class) @Import({ CacheMeterBinderProvidersConfiguration.class, CacheMetricsRegistrarConfiguration.class }) public class CacheMetricsConfiguration { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsProperties.java deleted file mode 100644 index 58199f3db60..00000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsProperties.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2012-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.actuate.autoconfigure.metrics.cache; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Configuration properties for Cache-based metrics. - * - * @author Stephane Nicoll - * @since 2.0.0 - */ -@ConfigurationProperties("management.metrics.cache") -public class CacheMetricsProperties { - - /** - * Name of the metric for cache usage. - */ - private String metricName = "cache"; - - public String getMetricName() { - return this.metricName; - } - - public void setMetricName(String metricName) { - this.metricName = metricName; - } - -} diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java index 96de0bbf21d..73f710c3a90 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java @@ -49,24 +49,19 @@ class CacheMetricsRegistrarConfiguration { private final Collection> binderProviders; - private final CacheMetricsProperties properties; - private final Map cacheManagers; CacheMetricsRegistrarConfiguration(MeterRegistry registry, - CacheMetricsProperties properties, Collection> binderProviders, Map cacheManagers) { this.registry = registry; - this.properties = properties; this.binderProviders = binderProviders; this.cacheManagers = cacheManagers; } @Bean public CacheMetricsRegistrar cacheMetricsRegistrar() { - return new CacheMetricsRegistrar(this.registry, this.properties.getMetricName(), - this.binderProviders); + return new CacheMetricsRegistrar(this.registry, this.binderProviders); } @PostConstruct diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java index c4ba64c72d3..a57ce95484f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java @@ -44,21 +44,9 @@ public class CacheMetricsConfigurationTests { this.contextRunner.withPropertyValues("spring.cache.type=caffeine", "spring.cache.cache-names=cache1,cache2").run((context) -> { MeterRegistry registry = context.getBean(MeterRegistry.class); - registry.get("cache.requests").tags("name", "cache1") + registry.get("cache.gets").tags("name", "cache1") .tags("cacheManager", "cacheManager").meter(); - registry.get("cache.requests").tags("name", "cache2") - .tags("cacheManager", "cacheManager").meter(); - }); - } - - @Test - public void autoConfiguredCacheManagerWithCustomMetricName() { - this.contextRunner - .withPropertyValues("management.metrics.cache.metric-name=custom.name", - "spring.cache.type=caffeine", "spring.cache.cache-names=cache1") - .run((context) -> { - MeterRegistry registry = context.getBean(MeterRegistry.class); - registry.get("custom.name.requests").tags("name", "cache1") + registry.get("cache.gets").tags("name", "cache2") .tags("cacheManager", "cacheManager").meter(); }); } @@ -68,9 +56,9 @@ public class CacheMetricsConfigurationTests { this.contextRunner.withPropertyValues("spring.cache.type=simple", "spring.cache.cache-names=cache1,cache2").run((context) -> { MeterRegistry registry = context.getBean(MeterRegistry.class); - assertThat(registry.find("cache.requests").tags("name", "cache1") + assertThat(registry.find("cache.gets").tags("name", "cache1") .tags("cacheManager", "cacheManager").meter()).isNull(); - assertThat(registry.find("cache.requests").tags("name", "cache2") + assertThat(registry.find("cache.gets").tags("name", "cache2") .tags("cacheManager", "cacheManager").meter()).isNull(); }); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMeterBinderProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMeterBinderProvider.java index f850b4d57ac..3d44d5d64f2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMeterBinderProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMeterBinderProvider.java @@ -35,10 +35,9 @@ public interface CacheMeterBinderProvider { * Return the {@link MeterBinder} managing the specified {@link Cache} or {@code null} * if the specified {@link Cache} is not supported. * @param cache the cache to instrument - * @param name the name prefix of the metrics * @param tags tags to apply to all recorded metrics * @return a {@link MeterBinder} handling the specified {@link Cache} or {@code null} */ - MeterBinder getMeterBinder(C cache, String name, Iterable tags); + MeterBinder getMeterBinder(C cache, Iterable tags); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java index bf00ec205ec..d3e717e9c81 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java @@ -37,21 +37,17 @@ public class CacheMetricsRegistrar { private final MeterRegistry registry; - private final String metricName; - private final Collection> binderProviders; /** * Creates a new registrar. * @param registry the {@link MeterRegistry} to use - * @param metricName the name of the metric * @param binderProviders the {@link CacheMeterBinderProvider} instances that should * be used to detect compatible caches */ - public CacheMetricsRegistrar(MeterRegistry registry, String metricName, + public CacheMetricsRegistrar(MeterRegistry registry, Collection> binderProviders) { this.registry = registry; - this.metricName = metricName; this.binderProviders = binderProviders; } @@ -78,7 +74,7 @@ public class CacheMetricsRegistrar { .callbacks(CacheMeterBinderProvider.class, this.binderProviders, cache) .withLogger(CacheMetricsRegistrar.class) .invokeAnd((binderProvider) -> binderProvider.getMeterBinder(cache, - this.metricName, cacheTags)) + cacheTags)) .filter(Objects::nonNull).findFirst().orElse(null); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CaffeineCacheMeterBinderProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CaffeineCacheMeterBinderProvider.java index 11a3968fd3a..71bcf63a149 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CaffeineCacheMeterBinderProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CaffeineCacheMeterBinderProvider.java @@ -32,9 +32,8 @@ public class CaffeineCacheMeterBinderProvider implements CacheMeterBinderProvider { @Override - public MeterBinder getMeterBinder(CaffeineCache cache, String name, - Iterable tags) { - return new CaffeineCacheMetrics(cache.getNativeCache(), name, tags); + public MeterBinder getMeterBinder(CaffeineCache cache, Iterable tags) { + return new CaffeineCacheMetrics(cache.getNativeCache(), cache.getName(), tags); } } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/EhCache2CacheMeterBinderProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/EhCache2CacheMeterBinderProvider.java index 53a775da9c9..f7867f76933 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/EhCache2CacheMeterBinderProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/EhCache2CacheMeterBinderProvider.java @@ -32,9 +32,8 @@ public class EhCache2CacheMeterBinderProvider implements CacheMeterBinderProvider { @Override - public MeterBinder getMeterBinder(EhCacheCache cache, String name, - Iterable tags) { - return new EhCache2Metrics(cache.getNativeCache(), name, tags); + public MeterBinder getMeterBinder(EhCacheCache cache, Iterable tags) { + return new EhCache2Metrics(cache.getNativeCache(), tags); } } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProvider.java index 660bcee0b43..a3aa5560041 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProvider.java @@ -33,10 +33,9 @@ public class HazelcastCacheMeterBinderProvider @Override @SuppressWarnings("unchecked") - public MeterBinder getMeterBinder(HazelcastCache cache, String name, - Iterable tags) { + public MeterBinder getMeterBinder(HazelcastCache cache, Iterable tags) { return new HazelcastCacheMetrics((IMap) cache.getNativeCache(), - name, tags); + tags); } } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/JCacheCacheMeterBinderProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/JCacheCacheMeterBinderProvider.java index 65188c5a920..f323e737682 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/JCacheCacheMeterBinderProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/JCacheCacheMeterBinderProvider.java @@ -32,9 +32,8 @@ public class JCacheCacheMeterBinderProvider implements CacheMeterBinderProvider { @Override - public MeterBinder getMeterBinder(JCacheCache cache, String name, - Iterable tags) { - return new JCacheMetrics(cache.getNativeCache(), name, tags); + public MeterBinder getMeterBinder(JCacheCache cache, Iterable tags) { + return new JCacheMetrics(cache.getNativeCache(), tags); } } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrarTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrarTests.java index 41ebac1e17c..84a41e06e4b 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrarTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrarTests.java @@ -39,20 +39,20 @@ public class CacheMetricsRegistrarTests { @Test public void bindToSupportedCache() { CacheMetricsRegistrar registrar = new CacheMetricsRegistrar(this.meterRegistry, - "root", Collections.singleton(new CaffeineCacheMeterBinderProvider())); + Collections.singleton(new CaffeineCacheMeterBinderProvider())); assertThat(registrar.bindCacheToRegistry( new CaffeineCache("test", Caffeine.newBuilder().build()))).isTrue(); - assertThat(this.meterRegistry.get("root.requests").tags("name", "test").meter()) + assertThat(this.meterRegistry.get("cache.gets").tags("name", "test").meter()) .isNotNull(); } @Test public void bindToUnsupportedCache() { CacheMetricsRegistrar registrar = new CacheMetricsRegistrar(this.meterRegistry, - "root", Collections.emptyList()); + Collections.emptyList()); assertThat(registrar.bindCacheToRegistry( new CaffeineCache("test", Caffeine.newBuilder().build()))).isFalse(); - assertThat(this.meterRegistry.find("root.requests").tags("name", "test").meter()) + assertThat(this.meterRegistry.find("cache.gets").tags("name", "test").meter()) .isNull(); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/CaffeineCacheMeterBinderProviderTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/CaffeineCacheMeterBinderProviderTests.java index e81f00f7ad1..e41f4190ab3 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/CaffeineCacheMeterBinderProviderTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/CaffeineCacheMeterBinderProviderTests.java @@ -38,7 +38,7 @@ public class CaffeineCacheMeterBinderProviderTests { public void caffeineCacheProvider() { CaffeineCache cache = new CaffeineCache("test", Caffeine.newBuilder().build()); MeterBinder meterBinder = new CaffeineCacheMeterBinderProvider() - .getMeterBinder(cache, "test", Collections.emptyList()); + .getMeterBinder(cache, Collections.emptyList()); assertThat(meterBinder).isInstanceOf(CaffeineCacheMetrics.class); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/EhCache2CacheMeterBinderProviderTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/EhCache2CacheMeterBinderProviderTests.java index f26f500fbe0..9a055ffbdb1 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/EhCache2CacheMeterBinderProviderTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/EhCache2CacheMeterBinderProviderTests.java @@ -47,7 +47,7 @@ public class EhCache2CacheMeterBinderProviderTests { cacheManager.addCache(nativeCache); EhCacheCache cache = new EhCacheCache(nativeCache); MeterBinder meterBinder = new EhCache2CacheMeterBinderProvider() - .getMeterBinder(cache, "test", Collections.emptyList()); + .getMeterBinder(cache, Collections.emptyList()); assertThat(meterBinder).isInstanceOf(EhCache2Metrics.class); } finally { diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProviderTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProviderTests.java index 99f0c4a3dcc..126ebd3a1e4 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProviderTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProviderTests.java @@ -24,10 +24,11 @@ import io.micrometer.core.instrument.binder.MeterBinder; import io.micrometer.core.instrument.binder.cache.HazelcastCacheMetrics; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; /** * Tests for {@link HazelcastCacheMeterBinderProvider}. @@ -37,14 +38,14 @@ import static org.assertj.core.api.Assertions.assertThat; @RunWith(MockitoJUnitRunner.class) public class HazelcastCacheMeterBinderProviderTests { - @Mock - private IMap nativeCache; - + @SuppressWarnings("unchecked") @Test public void hazelcastCacheProvider() { - HazelcastCache cache = new HazelcastCache(this.nativeCache); + IMap nativeCache = mock(IMap.class); + given(nativeCache.getName()).willReturn("test"); + HazelcastCache cache = new HazelcastCache(nativeCache); MeterBinder meterBinder = new HazelcastCacheMeterBinderProvider() - .getMeterBinder(cache, "test", Collections.emptyList()); + .getMeterBinder(cache, Collections.emptyList()); assertThat(meterBinder).isInstanceOf(HazelcastCacheMetrics.class); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/JCacheCacheMeterBinderProviderTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/JCacheCacheMeterBinderProviderTests.java index 7a5ca9add65..c1da8494249 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/JCacheCacheMeterBinderProviderTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/JCacheCacheMeterBinderProviderTests.java @@ -52,7 +52,7 @@ public class JCacheCacheMeterBinderProviderTests { given(this.nativeCache.getName()).willReturn("test"); JCacheCache cache = new JCacheCache(this.nativeCache); MeterBinder meterBinder = new JCacheCacheMeterBinderProvider() - .getMeterBinder(cache, "test", Collections.emptyList()); + .getMeterBinder(cache, Collections.emptyList()); assertThat(meterBinder).isInstanceOf(JCacheMetrics.class); } diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 79d318ab474..9eb3393c744 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -1297,7 +1297,6 @@ content into your application. Rather, pick only the properties that you need. management.metrics.binders.logback.enabled=true # Whether to enable Logback metrics. management.metrics.binders.processor.enabled=true # Whether to enable processor metrics. management.metrics.binders.uptime.enabled=true # Whether to enable uptime metrics. - management.metrics.cache.metric-name=cache # Name of the metric for cache usage. management.metrics.cache.instrument=true # Instrument all available caches. management.metrics.export.atlas.batch-size= # Number of measurements per request to use for the backend. If more measurements are found, then multiple requests will be made. management.metrics.export.atlas.config-refresh-frequency= # Frequency for refreshing config settings from the LWC service. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 0235a51d5a7..261f1d38232 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -1194,10 +1194,9 @@ following information: [[production-ready-metrics-cache]] === Cache metrics Auto-configuration will enable the instrumentation of all available ``Cache``s on startup -with a metric named `cache`. The prefix can be customized by using the -`management.metrics.cache.metric-name` property. Cache instrumentation is specific -to each cache library, refer to https://micrometer.io/docs[the micrometer documentation] -for more details. +with metrics prefixed with `cache.`. Cache instrumentation is standardized for a basic set +of metrics. Additional, cache-specific metrics are also available. Please refer to +https://micrometer.io/docs[the Micrometer documentation] for more details. The following cache libraries are supported: @@ -1206,8 +1205,8 @@ The following cache libraries are supported: * Hazelcast * Any compliant JCache (JSR-107) implementation -Metrics will also be tagged by the name of the `CacheManager` computed based on the bean -name. +Metrics are tagged by the name of the cache and by the name of the `CacheManager` that is +derived from the bean name. NOTE: Only caches that are available on startup are bound to the registry. For caches created on-the-fly or programmatically after the startup phase, an explicit registration