本文介绍了如何通过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());此后,您将在comlix.servo中看到有关JMX的指标.
After this you'll see the metrics on JMX in comlix.servo.
糟糕:只有在第一个服务器请求之后,该信息才在JMX上可用.
Obs: The information will be available on JMX only after the first server request.
更多推荐
如何通过JMX公开Hystrix的断路器状态
发布评论