执行器/指标端点中的Hystrix指标[spring-boot 2.0]

时间:2018-06-06 20:09:34

标签: spring-boot hystrix spring-boot-actuator

有可能以与spring-boot 1.5相同的方式获取hystrix指标信息吗?

在1.5度量终点中我有这样的东西:

"gauge.servo.hystrix.hystrixcommand.[service-name].[method].errorcount": 0,     
"gauge.servo.hystrix.hystrixcommand.[service-name].[method].requestcount": 0,
"gauge.servo.hystrix.hystrixcommand.[service-name].[method].latencytotal_mean": 0,

但是现在使用千分尺的执行器/公制端点,我找不到任何对“hystrix”,“netflix”等术语的引用。

我已经使用@EnableCircuitBreakerhystrix:metrics:enabled: true配置了我的应用程序。

有一些方法可以在不使用hystrix.stream端点的情况下获取此信息,因为我以前能够使用?或者这应该有效,我做错了什么?

1 个答案:

答案 0 :(得分:0)

在此tutorial之后,您必须将以下bean添加到您的应用程序中,以注册Hystrix Metrics Binder:

@Configuration
public class MetricsConfig {

@Bean
HystrixMetricsBinder registerHystrixMetricsBinder() {
    return new HystrixMetricsBinder();
 }
}

正如本issue中的解释说明,hystrix指标现在应显示如下:

  

hystrix.errors {event =“ short_circuited”}