Skip to content

Commit

Permalink
Tweak conditions on metric export to make it easier to override
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyer committed May 29, 2015
1 parent 88c640e commit a49901f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class MetricExportAutoConfiguration {
private MetricsEndpointMetricReader endpointReader;

@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean(name = "metricWritersMetricExporter")
public SchedulingConfigurer metricWritersMetricExporter() {

Map<String, MetricWriter> writers = new HashMap<String, MetricWriter>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class MetricRepositoryAutoConfiguration {
static class LegacyMetricServicesConfiguration {

@Autowired
@ActuatorMetricReader
@ActuatorMetricWriter
private MetricWriter writer;

@Bean
Expand Down Expand Up @@ -147,11 +147,12 @@ public GaugeService gaugeService(GaugeBuffers writer) {

@Configuration
@ConditionalOnJava(value = JavaVersion.EIGHT, range = Range.OLDER_THAN)
@ConditionalOnMissingBean(MetricRepository.class)
@ConditionalOnMissingBean(name = "actuatorMetricRepository")
static class LegacyMetricRepositoryConfiguration {

@Bean
@ActuatorMetricReader
@ActuatorMetricWriter
public InMemoryMetricRepository actuatorMetricRepository() {
return new InMemoryMetricRepository();
}
Expand Down

0 comments on commit a49901f

Please sign in to comment.