Tweak conditions on metric export to make it easier to override
This commit is contained in:
@@ -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>();
|
||||
|
||||
@@ -90,7 +90,7 @@ public class MetricRepositoryAutoConfiguration {
|
||||
static class LegacyMetricServicesConfiguration {
|
||||
|
||||
@Autowired
|
||||
@ActuatorMetricReader
|
||||
@ActuatorMetricWriter
|
||||
private MetricWriter writer;
|
||||
|
||||
@Bean
|
||||
@@ -147,11 +147,12 @@ public class MetricRepositoryAutoConfiguration {
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user