SpringCloud's circuit breaker aggregation monitoring (Hystrix Turbine)

SpringCloud's circuit breaker aggregation monitoring (Hystrix Turbine)

1. Introduction
to Hystrix Turbine Looking at the data of a single Hystrix Dashboard does not have much value. If you want to see the Hystrix Dashboard data of this system, you need to use Hystrix Turbine. Hystrix Turbine integrates Hystrix Dashboard data for each service. The use of Hystrix Turbine is very simple, you only need to introduce the corresponding dependencies and add annotations and configurations.

2. Preparatory work
The project used in this article is the project of the previous article, which is to be modified on this basis. Because we need Dashboards for multiple services, we need to build another service, named service-lucy, and its basic configuration is the same as service-hi. See the source code for details, so I won t elaborate on it here.

3. create service-turbine to
introduce the corresponding dependencies:


Add the annotation @EnableTurbine to its entry class ServiceTurbineApplication to turn on the turbine. The @EnableTurbine annotation includes the @EnableDiscoveryClient annotation, that is, the registration service is turned on.

public class ServiceTurbineApplication {
     * http://localhost:8764/turbine.stream
    public static void main(String[] args) {
        SpringApplication.run( ServiceTurbineApplication.class, args );

Configuration file application.yml:

  application.name: service-turbine
  port: 8769
security.basic.enabled: false
    clusterConfig: default   #  "," default http://.../turbine.stream?cluster={clusterConfig } 
  appConfig: service-hi,service-la  ###  Eureka serviceId 
  clusterNameExpression: new String("default")
  # 1. clusterNameExpression appName turbine.aggregator.clusterConfig 
  # 2.  clusterNameExpression: default turbine.aggregator.clusterConfig default
  # 3.  clusterNameExpression: metadata['cluster'] eureka.instance.metadata-map.cluster: ABC turbine.aggregator.clusterConfig: ABC
      defaultZone: http://localhost:8761/eureka/

The configuration file comments are clearly written. Welcome everyone to study and research related technologies. Friends who are willing to understand the source code directly ask for exchanges and share technologies: 2147775633

The Turbine demonstration
starts the server, service-hi, service-la, and service-turbine projects in sequence.
Open the browser and enter: http://localhost:8769/turbine.stream ,

Request in turn:


Open: http://localhost:8763/hystrix, enter the monitoring stream http://localhost:8769/turbine.stream

You can see that this page aggregates the hystrix dashbord data of 2 services.