Can't view Hystrix metrics in Dropwizard app with hystrix-metrics-event-stream servlet

I have a Dropwizard 0.8.1 application to which I have added several classes HystrixCommand

to call various external services. Now I want to visualize the statistics related to calls to these services, but I cannot get my application to play well with Hystrix Dashboard . All the documentation seems to imply that if I get a servlet hystrix-metrics-event-stream

that runs in my application then everything should work just fine, but when I call my servlet endpoint directly ( curl http://localhost:8080/hystrix.stream

) I just get a long stream of lines ping:

implying there are no available indicators for publication. I have a cron job repeatedly calling my objects HystrixCommand

to try and generate some statistics, but to no avail.

Is there something I am not doing? I added a dependency on mine pom.xml

:

<dependency>
    <groupId>com.netflix.hystrix</groupId>
    <artifactId>hystrix-metrics-event-stream</artifactId>
    <version>1.4.5</version>
</dependency>

      

I have included the servlet in Dropwizard in App.java

:

public void run(final AppConfig configuration, final Environment environment) throws Exception {
...
environment.getApplicationContext().addServlet("com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet", "/hystrix.stream");

      

Is it possible that I need to manually post the metrics data to be selected HystrixMetricsPoller

? Or maybe I need to tweak some settings for my dev environment? Help is appreciated!

+3


source to share


1 answer


Sorted! It turned out that the version of the artifact hystrix-metrics-event-stream

was 1.4.5, but the version hystrix-core

was 1.3.8. I didn't notice it at first because it was saved in another POM file. Now I use the exact same version in all hystrix packages and just get the data from the servlet hystrix.stream

.



As related aside, I also found the hystrix-dropwizard-bundle , which looks much simpler and more flexible. integrating Dropwizard with Hystrix for most people than doing it from scratch or using something as complex as Tenacity. It includes support HystrixCodaHaleMetricsPublisher

that might be helpful for people using Dropwizard metrics (we are not).

+3


source







All Articles