Spring boot 如何覆盖hystrix metrics流端点的url后缀?
在我们的设置中,我们有很多dropwizard服务,这些服务将其度量数据流式传输到hystrix仪表板 我们正在Spring Boot中编写一个新服务,希望度量流与dropwizard流位于同一url上,但我无法找到如何覆盖流servlet的url模式Spring boot 如何覆盖hystrix metrics流端点的url后缀?,spring-boot,dropwizard,metrics,microservices,Spring Boot,Dropwizard,Metrics,Microservices,在我们的设置中,我们有很多dropwizard服务,这些服务将其度量数据流式传输到hystrix仪表板 我们正在Spring Boot中编写一个新服务,希望度量流与dropwizard流位于同一url上,但我无法找到如何覆盖流servlet的url模式 我相信这是可以配置的,有什么想法吗 必须注册一个自定义bean来覆盖应用程序类中这样的硬编码值: @Bean public CustomHystrixStreamEndpoint customHystrixStreamEndpoint() {
我相信这是可以配置的,有什么想法吗 必须注册一个自定义bean来覆盖应用程序类中这样的硬编码值:
@Bean
public CustomHystrixStreamEndpoint customHystrixStreamEndpoint() {
return new CustomHystrixStreamEndpoint();
}
然后创建自定义包装器类,如下所示:
public class CustomHystrixStreamEndpoint extends ServletWrappingEndpoint {
public CustomHystrixStreamEndpoint() {
super(HystrixMetricsStreamServlet.class, "customHystrixStream",
"/tenacity/hystrix.stream",
false, true);
}
}
然后在配置文件中关闭默认设置,如下所示:
hystrix.stream.endpoint.enabled: false
仅供参考,默认包装器类称为HystrixStreamEndpoint