From 3929447e593677c6a70f9705e4f7e40d98d88c62 Mon Sep 17 00:00:00 2001 From: Robert Winkler Date: Fri, 15 Sep 2017 09:28:03 +0200 Subject: [PATCH] Issue #161: Fixed Spring Boot Prometheus AutoConfiguration --- .../CircuitBreakerPrometheusAutoConfiguration.java | 3 +-- .../autoconfigure/RateLimiterPrometheusAutoConfiguration.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/resilience4j-spring-boot/src/main/java/io/github/resilience4j/circuitbreaker/autoconfigure/CircuitBreakerPrometheusAutoConfiguration.java b/resilience4j-spring-boot/src/main/java/io/github/resilience4j/circuitbreaker/autoconfigure/CircuitBreakerPrometheusAutoConfiguration.java index e85d813634..e033118ba7 100644 --- a/resilience4j-spring-boot/src/main/java/io/github/resilience4j/circuitbreaker/autoconfigure/CircuitBreakerPrometheusAutoConfiguration.java +++ b/resilience4j-spring-boot/src/main/java/io/github/resilience4j/circuitbreaker/autoconfigure/CircuitBreakerPrometheusAutoConfiguration.java @@ -17,7 +17,6 @@ import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry; import io.github.resilience4j.prometheus.CircuitBreakerExports; -import io.prometheus.client.CollectorRegistry; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Bean; @@ -29,7 +28,7 @@ */ @Configuration @AutoConfigureAfter(value = CircuitBreakerAutoConfiguration.class) -@ConditionalOnClass(CollectorRegistry.class) +@ConditionalOnClass(CircuitBreakerExports.class) public class CircuitBreakerPrometheusAutoConfiguration { @Bean public CircuitBreakerExports circuitBreakerPrometheusCollector(CircuitBreakerRegistry circuitBreakerRegistry){ diff --git a/resilience4j-spring-boot/src/main/java/io/github/resilience4j/ratelimiter/autoconfigure/RateLimiterPrometheusAutoConfiguration.java b/resilience4j-spring-boot/src/main/java/io/github/resilience4j/ratelimiter/autoconfigure/RateLimiterPrometheusAutoConfiguration.java index 14ac15b893..e1455ab12d 100644 --- a/resilience4j-spring-boot/src/main/java/io/github/resilience4j/ratelimiter/autoconfigure/RateLimiterPrometheusAutoConfiguration.java +++ b/resilience4j-spring-boot/src/main/java/io/github/resilience4j/ratelimiter/autoconfigure/RateLimiterPrometheusAutoConfiguration.java @@ -17,7 +17,6 @@ import io.github.resilience4j.prometheus.RateLimiterExports; import io.github.resilience4j.ratelimiter.RateLimiterRegistry; -import io.prometheus.client.CollectorRegistry; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Bean; @@ -29,7 +28,7 @@ */ @Configuration @AutoConfigureAfter(value = RateLimiterAutoConfiguration.class) -@ConditionalOnClass(CollectorRegistry.class) +@ConditionalOnClass(RateLimiterExports.class) public class RateLimiterPrometheusAutoConfiguration { @Bean public RateLimiterExports rateLimiterPrometheusCollector(RateLimiterRegistry rateLimiterRegistry){