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

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

Loading…
Cancel
Save