如何通过JMX公开Hystrix的断路器状态 [英] How to expose Hystrix's circuit breaker status through JMX
本文介绍了如何通过JMX公开Hystrix的断路器状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在寻找有关如何在JMX上公开Hystrix断路器状态的教程.我刚刚找到了一个使用hystrix-servo-metrics-publisher
公开指标(例如计数器,仪表等)的API.
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
.
是否可以在JMX上显示断路器状态?
Is it possible to expose circuit breaker status on JMX?
推荐答案
我找到了解决方案,只需启动以下代码即可:
I found the solution, just start this code:
HystrixPlugins.getInstance().registerMetricsPublisher(
HystrixServoMetricsPublisher.getInstance());
此后,您将在com.netlix.servo
中看到有关JMX的指标.
After this you'll see the metrics on JMX in com.netlix.servo
.
糟糕:只有在第一个服务器请求之后,该信息才在JMX上可用.
Obs: The information will be available on JMX only after the first server request.
这篇关于如何通过JMX公开Hystrix的断路器状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文