Commit af88007c by Spencer Gibb

Merge pull request #745 from jkschneider/metrics-deconflict-services

Servo and Spectator metrics defer to other Counter/GaugeServices
parents c1e567af af5c2360
...@@ -15,6 +15,8 @@ package org.springframework.cloud.netflix.metrics.servo; ...@@ -15,6 +15,8 @@ package org.springframework.cloud.netflix.metrics.servo;
import org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration;
import org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics; import org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics;
import org.springframework.boot.actuate.metrics.CounterService;
import org.springframework.boot.actuate.metrics.GaugeService;
import org.springframework.boot.actuate.metrics.reader.MetricReader; import org.springframework.boot.actuate.metrics.reader.MetricReader;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
...@@ -76,6 +78,7 @@ public class ServoMetricsAutoConfiguration { ...@@ -76,6 +78,7 @@ public class ServoMetricsAutoConfiguration {
} }
@Bean @Bean
@ConditionalOnMissingBean({ CounterService.class, GaugeService.class })
public ServoMetricServices servoMetricServices(MonitorRegistry monitorRegistry) { public ServoMetricServices servoMetricServices(MonitorRegistry monitorRegistry) {
return new ServoMetricServices(monitorRegistry); return new ServoMetricServices(monitorRegistry);
} }
......
...@@ -16,6 +16,8 @@ package org.springframework.cloud.netflix.metrics.spectator; ...@@ -16,6 +16,8 @@ package org.springframework.cloud.netflix.metrics.spectator;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration;
import org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics; import org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics;
import org.springframework.boot.actuate.metrics.CounterService;
import org.springframework.boot.actuate.metrics.GaugeService;
import org.springframework.boot.actuate.metrics.reader.MetricReader; import org.springframework.boot.actuate.metrics.reader.MetricReader;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
...@@ -71,6 +73,7 @@ public class SpectatorMetricsAutoConfiguration { ...@@ -71,6 +73,7 @@ public class SpectatorMetricsAutoConfiguration {
} }
@Bean @Bean
@ConditionalOnMissingBean({ CounterService.class, GaugeService.class })
public SpectatorMetricServices spectatorMetricServices(Registry metricRegistry) { public SpectatorMetricServices spectatorMetricServices(Registry metricRegistry) {
return new SpectatorMetricServices(metricRegistry); return new SpectatorMetricServices(metricRegistry);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment