title: How to expose Hystrix Stream on Spring Actuator port?
body: <p>I am using Jetty embedded server in the Spring Boot application.</p>
  
  <p>To handle requests I provide my custom handler like that.</p>
  
  <pre><code>@Slf4j
  @Configuration
  @EnableWebMvc
  @SpringBootApplication
  public class Main {
      public static void main(String... args) {
          new SpringApplicationBuilder().sources(Main.class).run(args);
      }
  
      @Bean
      public EmbeddedServletContainerCustomizer customizer(JettyRequestHandler myCustomHandler) throws MalformedURLException {
          return new EmbeddedServletContainerCustomizer() {
  
              @Override
              public void customize(ConfigurableEmbeddedServletContainer container) {
                  if (container instanceof JettyEmbeddedServletContainerFactory) {
                      customizeJetty((JettyEmbeddedServletContainerFactory) container);
                  }
              }
  
              private void customizeJetty(JettyEmbeddedServletContainerFactory jetty) {
                  jetty.addServerCustomizers((JettyServerCustomizer) server -&gt; {
                      HandlerCollection handlerCollection = new HandlerCollection();
                      handlerCollection.setHandlers(new Handler[]{myCustomHandler, server.getHandler()});
                      server.setHandler(handlerCollection);
                  });
              }
          };
      }
  }
  </code></pre>
  
  <p>I am listening for a requests on a standard <code>8080</code> port. I included also <code>Spring Boot Actuator</code> into my project to get some production endpoints (health, etc.).  It starts on another port: <code>8181</code>.</p>
  
  <p>Additionally I am using Hystrix for circuit breaking purposes.</p>
  
  <p>My question is how to enable Hystrix Stream to be exposed on actuator port?</p>
  
  <p>Currently I managed only to expose it on standard port <code>8080</code> with following piece of code:</p>
  
  <pre><code>@Bean
  public ServletRegistrationBean hystrixStreamServlet(){
      return new ServletRegistrationBean(new HystrixMetricsStreamServlet(), "/hystrix.stream");
  }
  </code></pre>
  
  <p>But I would like to expose it on another, to have the default one only for application purposes.</p>
  
  <p>Those are some of my dependecies:</p>
  
  <pre><code>compile 'com.netflix.hystrix:hystrix-core:1.5.3'
  compile 'com.netflix.hystrix:hystrix-metrics-event-stream:1.5.3' 
  compile 'org.springframework.boot:spring-boot-starter-actuator:1.3.5.RELEASE' 
  </code></pre>
  
  <p>I would like NOT to use Spring Cloud where is @EnableHystrix that gives the stream on the actuator port actually.</p>