2

How to integrate Resilience-4J and Prometheus with micro-services.

I have integrated Micro-services with resilience 4j and also with Prometheus . My problem is ,in Prometheus i am not getting any resilience query,only HTTP and other which comes default are populating .

Kindly help
Steps that i have implemented so far are listed below...
1>created micro-services
2>Integrate micro-services with Resilience 4j by following steps
    i>dependency in pom.xml file
    ii>created separate class of Circuit-breaker and retry module.
    iii>After that i have added Prometheus by adding its jar 
  which is...

 <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-registry-prometheus</artifactId>
    </dependency>

3>In Prometheus Dashboard resilience queries/matrices are not populating.

i.e # HELP resilience4j_circuit-breaker_calls Circuit Breaker Call Stats
      # TYPE resilience4j_circuit-breaker_calls gauge
       resilience4j_circuit-breaker_calls{name="backendB",call_result="successful",} 0.0
       resilience4j_circuit-breaker_calls{name="backendB",call_result="failed",} 0.0

Kindly help. Thanks in Advance

i have also added below dependencies for resilience 4j and Prometheus integration...

 <dependency>
             <groupId>io.github.resilience4j</groupId>
             <artifactId>resilience4j-metrics</artifactId>
             <version>0.16.0</version>
 </dependency>

   <dependency>
            <groupId>io.github.resilience4j</groupId>
            <artifactId>resilience4j-prometheus</artifactId>
            <version>0.16.0</version>
   </dependency>

want resilience matrices on Prometheus dashboard.

Mahesh Nighut
  • 115
  • 1
  • 10

1 Answers1

0

Do you use a Framework like Spring Boot 1 or Spring Boot 2? If that's the case you can have a look at our demo which also includes a Grafana Dashboard for Prometheus.

https://github.com/resilience4j/resilience4j-spring-boot2-demo

If you want to use Micrometer you should not add resilience4j-prometheus or resilience4j-metrics. resilience4j-prometheus uses the Prometheus Java library and resilience4j-metrics uses Dropwizard Metrics. You should add resilience4j-micrometer instead. But it's not necessary if you use our Spring Boot 2 starter.

Robert Winkler
  • 1,734
  • 9
  • 8