Search code examples
javajmxhystrix

How to expose Hystrix's circuit breaker status through JMX


I've been looking for a tutorial on how to expose Hystrix's circuit breaker status on JMX. I just found out an API for exposing metrics (e.g counters, gauges, etc) using hystrix-servo-metrics-publisher.

Is it possible to expose circuit breaker status on JMX?


Solution

  • I found the solution, just start this code:

    HystrixPlugins.getInstance().registerMetricsPublisher(
        HystrixServoMetricsPublisher.getInstance());
    

    After this you'll see the metrics on JMX in com.netlix.servo.

    Obs: The information will be available on JMX only after the first server request.