diff --git a/proxy/src/main/java/io/micrometer/prometheus/rsocket/PrometheusRSocketProxyMain.java b/proxy/src/main/java/io/micrometer/prometheus/rsocket/PrometheusRSocketProxyMain.java index 8104722..5e429a5 100644 --- a/proxy/src/main/java/io/micrometer/prometheus/rsocket/PrometheusRSocketProxyMain.java +++ b/proxy/src/main/java/io/micrometer/prometheus/rsocket/PrometheusRSocketProxyMain.java @@ -16,10 +16,11 @@ package io.micrometer.prometheus.rsocket; import io.micrometer.prometheus.rsocket.autoconfigure.EnablePrometheusRSocketProxyServer; +import io.micrometer.prometheus.rsocket.autoconfigure.PrometheusRSocketClientAutoConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -@SpringBootApplication +@SpringBootApplication(exclude = PrometheusRSocketClientAutoConfiguration.class) @EnablePrometheusRSocketProxyServer public class PrometheusRSocketProxyMain { public static void main(String[] args) { diff --git a/starter-spring/src/main/java/io/micrometer/prometheus/rsocket/autoconfigure/PrometheusRSocketClientAutoConfiguration.java b/starter-spring/src/main/java/io/micrometer/prometheus/rsocket/autoconfigure/PrometheusRSocketClientAutoConfiguration.java index 53c580f..e166e18 100644 --- a/starter-spring/src/main/java/io/micrometer/prometheus/rsocket/autoconfigure/PrometheusRSocketClientAutoConfiguration.java +++ b/starter-spring/src/main/java/io/micrometer/prometheus/rsocket/autoconfigure/PrometheusRSocketClientAutoConfiguration.java @@ -20,7 +20,7 @@ import io.micrometer.prometheus.rsocket.PrometheusRSocketClient; import org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusMetricsExportAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -30,7 +30,7 @@ @Configuration @AutoConfigureAfter(PrometheusMetricsExportAutoConfiguration.class) -@ConditionalOnClass(PrometheusMeterRegistry.class) +@ConditionalOnBean(PrometheusMeterRegistry.class) @ConditionalOnProperty(prefix = "management.metrics.export.prometheus.rsocket", name = "enabled", havingValue = "true", matchIfMissing = true) @EnableConfigurationProperties(PrometheusRSocketClientProperties.class) public class PrometheusRSocketClientAutoConfiguration {