0

I have configured resilience4j-micrometer and spring-boot-starter-actuator in my service. Apparently this is enough to see metrics in Datadog but I do not see the values populated for the metric for example resilience4j_circuitbreaker_not_permitted_calls_total even though i see logs in my service that the circuit breaker is OPEN.

I tried to create a bean and do the following but no luck.

@Bean
public MeterRegistry enableCircuitBreakerMetrics() {
final CircuitBreakerRegistry circuitBreakerRegistry = CircuitBreakerRegistry.ofDefaults();
return registry -> {

            TaggedCircuitBreakerMetrics
                .ofCircuitBreakerRegistry(circuitBreakerRegistry)
                .bindTo(circuitBreakerRegistry );
        };
    }

Am I missing anything here? Could someone help? I have 2 feign clients where the circuit breaker name for this is autogenerated.

P H
  • 294
  • 1
  • 3
  • 16
  • How do you set up your Datadog agent? – Spyros Palaiokostas Jul 10 '23 at 13:59
  • That is set up correctly as I see other custom metrics. I have added the datadog-api-key and added -javaagent:/dd-java-agent.jar in the run config. – P H Jul 10 '23 at 14:31
  • What is the Resilience4j version and Spring Boot version that you are using? Also, could you provide the spring-boot startup debug logs related to `MetricsAutoConfiguration`? – Spyros Palaiokostas Jul 10 '23 at 15:58
  • Resilience4J is 2.1.7 and Springboot is 2.7.13 – P H Jul 11 '23 at 08:53
  • Actually, i do not see any logs related to MetricsAutoConfiguration – P H Jul 11 '23 at 08:58
  • You can enable auto-configuration logs by setting the `debug: true` property on `application.yml` as stated https://www.baeldung.com/spring-boot-auto-configuration-report – Spyros Palaiokostas Jul 11 '23 at 10:07
  • Yes i just did that. I still do not see any logs related to MetricsAutoConfiguration. – P H Jul 11 '23 at 12:15
  • Spring Boot auto-configures a composite MeterRegistry and adds a registry to the composite for each of the supported implementations that it finds on the classpath. Having a dependency on `micrometer-registry-{system}` in your runtime classpath is enough for Spring Boot to configure the registry. What kind of dep are you using? Or are you configuring the Micrometer in another way – Spyros Palaiokostas Jul 11 '23 at 13:23
  • Yeah, i had check on that. I am using micrometer-core for MeterRegistry. – P H Jul 11 '23 at 13:49
  • It is working now :) I had to explicitly enable resilience in our project as our library sets everything by default because each metric costs. – P H Jul 14 '23 at 06:13

0 Answers0