Skip to content

Commit

Permalink
Client autoconfiguration should be conditional on PrometheusMeterRegi…
Browse files Browse the repository at this point in the history
…stry bean (#37)

* exclude client autoconfiguration from proxy

Co-authored-by: ss047890 <scott.steele@cerner.com>
  • Loading branch information
smsteele and ss047890 authored Aug 21, 2020
1 parent 666f53f commit 9c4fc9b
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 @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit 9c4fc9b

Please sign in to comment.