April 16, 2017

Hystrix, Turbine with Spring Boot Admin

Spring Boot

Spring Boot Admin is a library which can be added to spring boot application to provide administrative capabilities.

In this article, I will focus on how Spring Boot Admin can be integrated with micro-services supporting Hystrix dashboard. Spring Boot Admin provides a single point of access to view dashboards of all registered services individually or aggregate all dashboard into a single view using Turbine.

 

Once you add the Hystrix library to your micro-service, the library exposes the metrics through the '/hystrix.stream' endpoint on the service. There's one stream per service. Clicking on the service in the spring boot admin will give you an easy access to the hystrix stream dashboard for that service.

 
 
Spring Boot Admin - Hystrix & Turbine
Spring Boot Admin - Hystrix & Turbine

Turbine is another library from Netflix which helps aggregate multiple Hystrix stream and display them in a single dashboard.

In order to be able to aggregate multiple Hystrix stream, Turbine needs to be able to determine which services are currently available and where the services are. This is usually achieved by using a service discovery framework like Consul or Eureka.

Here, I am using a Eureka server. Each micro-service has a Eureka client which automatically registers with the Eureka server on startup.

Turbine makes use of the instance discovery information provided by Eureka to establish connection to the micro-services and read their Hystrix stream. The individual streams are passed through the Turbine aggregator so as to be able to render data in a single view.