Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何覆盖hystrix metrics流端点的url后缀?_Spring Boot_Dropwizard_Metrics_Microservices - Fatal编程技术网

Spring boot 如何覆盖hystrix metrics流端点的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() {

在我们的设置中,我们有很多dropwizard服务,这些服务将其度量数据流式传输到hystrix仪表板

我们正在Spring Boot中编写一个新服务,希望度量流与dropwizard流位于同一url上,但我无法找到如何覆盖流servlet的url模式


我相信这是可以配置的,有什么想法吗

必须注册一个自定义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