Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to expose Hystrix's circuit breaker status through JMX

Tags:

java

jmx

hystrix

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?

like image 315
Lucas Pires Avatar asked Jul 09 '15 18:07

Lucas Pires


1 Answers

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.

like image 84
Lucas Pires Avatar answered Sep 29 '22 09:09

Lucas Pires