Browse Source

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

Servo and Spectator metrics defer to other Counter/GaugeServices
pull/6/head
Spencer Gibb 9 years ago
parent
commit
af88007cc3
  1. 3
      spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/metrics/servo/ServoMetricsAutoConfiguration.java
  2. 3
      spring-cloud-netflix-spectator/src/main/java/org/springframework/cloud/netflix/metrics/spectator/SpectatorMetricsAutoConfiguration.java

3
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/metrics/servo/ServoMetricsAutoConfiguration.java

@ -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.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.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@ -76,6 +78,7 @@ public class ServoMetricsAutoConfiguration { @@ -76,6 +78,7 @@ public class ServoMetricsAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean({ CounterService.class, GaugeService.class })
public ServoMetricServices servoMetricServices(MonitorRegistry monitorRegistry) {
return new ServoMetricServices(monitorRegistry);
}

3
spring-cloud-netflix-spectator/src/main/java/org/springframework/cloud/netflix/metrics/spectator/SpectatorMetricsAutoConfiguration.java

@ -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.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration;
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.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@ -71,6 +73,7 @@ public class SpectatorMetricsAutoConfiguration { @@ -71,6 +73,7 @@ public class SpectatorMetricsAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean({ CounterService.class, GaugeService.class })
public SpectatorMetricServices spectatorMetricServices(Registry metricRegistry) {
return new SpectatorMetricServices(metricRegistry);
}

Loading…
Cancel
Save