如何通过JMX公开Hystrix的断路器状态

编程入门 行业动态 更新时间:2024-10-27 12:34:05
本文介绍了如何通过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的断路器状态

本文发布于:2023-11-17 14:10:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1610155.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:断路器   状态   JMX   Hystrix

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!