See gh-12129
pull/12149/head
Stephane Nicoll 7 years ago
parent 5e61b646fa
commit 45476961c1

@ -51,8 +51,11 @@ class HikariDataSourceMetricsPostProcessor implements BeanPostProcessor {
private void bindMetricsRegistryToHikariDataSource(MeterRegistry registry, private void bindMetricsRegistryToHikariDataSource(MeterRegistry registry,
HikariDataSource dataSource) { HikariDataSource dataSource) {
dataSource.setMetricsTrackerFactory( if (dataSource.getMetricRegistry() == null
new MicrometerMetricsTrackerFactory(registry)); && dataSource.getMetricsTrackerFactory() == null) {
dataSource.setMetricsTrackerFactory(
new MicrometerMetricsTrackerFactory(registry));
}
} }
private MeterRegistry getMeterRegistry() { private MeterRegistry getMeterRegistry() {

Loading…
Cancel
Save