3

In our setup we have lots of Dropwizard services which are streaming their metrics to a Hystrix dashboard.

We are writing a new service in Spring Boot and would like the metrics stream to be on the same URL as the Dropwizard one, but I can't find out how to override the stream servlet's URL pattern.

I'm sure this is configurable somehow, any ideas?

informatik01
  • 16,038
  • 10
  • 74
  • 104
barrymac
  • 2,750
  • 1
  • 20
  • 32

1 Answers1

4

Had to register a custom bean to override the hard coded value like this in the application class:

@Bean
public CustomHystrixStreamEndpoint customHystrixStreamEndpoint() {
    return new CustomHystrixStreamEndpoint();
}

and the create the custom wrapper class like this:

    public class CustomHystrixStreamEndpoint extends ServletWrappingEndpoint {

        public CustomHystrixStreamEndpoint() {
            super(HystrixMetricsStreamServlet.class, "customHystrixStream",
                  "/tenacity/hystrix.stream",
                  false, true);
        }
    }

and then turn off the default one like this in the config file:

hystrix.stream.endpoint.enabled: false

FYI the default wrapper class is called HystrixStreamEndpoint

barrymac
  • 2,750
  • 1
  • 20
  • 32