Skip to content

Commit a32c530

Browse files
dsyerwilkinsona
authored andcommitted
Add @primary to default InMemoryMetricRepository if there is one
1 parent 2aaf556 commit a32c530

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.springframework.boot.context.properties.EnableConfigurationProperties;
4848
import org.springframework.context.annotation.Bean;
4949
import org.springframework.context.annotation.Configuration;
50+
import org.springframework.context.annotation.Primary;
5051
import org.springframework.messaging.MessageChannel;
5152
import org.springframework.scheduling.annotation.EnableScheduling;
5253
import org.springframework.scheduling.annotation.Scheduled;
@@ -158,6 +159,7 @@ public GaugeService gaugeService(GaugeBuffers writer) {
158159
static class LegacyMetricRepositoryConfiguration {
159160

160161
@Bean
162+
@Primary
161163
public InMemoryMetricRepository actuatorMetricRepository() {
162164
return new InMemoryMetricRepository();
163165
}

0 commit comments

Comments
 (0)