Turbine Dashboard Is not Loading for Aggregation in Spring Cloud Microservice

1k Views Asked by At

I am trying to develop a spring cloud microservice using spring MVC and spring boot framework. And Eureka server , Zuul , Ribbon , hystrix and Turbine using for spring cloud. I already developed a microservice and implemented only hystrix dashboard. I am able to take hystrix dashboard. Now I am implementing more services. So I choosed turbine for aggregation of monitoring. But it not getting the dashboard.I implemented turbine in separate spring boot project.

My pom.xml containing,

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-turbine</artifactId>
</dependency>

And My main class containing,

@SpringBootApplication
@EnableHystrixDashboard
@EnableCircuitBreaker
@EnableTurbine

public class ZTurbineClientApplication {

    public static void main(String[] args) {
    SpringApplication.run(ZTurbineClientApplication.class, args);
    }
}

And my Turbine project application.properties file containing,

server.port=8085
spring.application.name=espace-Turbine
eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
turbine:
 aggregator:
  clusterConfig: APPCLUSTER
 app-config: espaceService1,espaceService2
 instanceUrlSuffix.APPCLUSTER: /hystrix.stream

And My previous first services's application.properties file like

eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
spring.application.name=espaceService1
server.port=8080
eureka:
  instance:
    prefer-ip-address: true
    leaseRenewalIntervalInSeconds: 3
    leaseExpirationDurationInSeconds: 3
    metadata-map:
      cluster: APPCLUSTER

And second service's application property file contains,

eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
spring.application.name=espaceService2
server.port=8081
eureka:
  instance:
    prefer-ip-address: true
    leaseRenewalIntervalInSeconds: 3
    leaseExpirationDurationInSeconds: 3
    metadata-map:
      cluster: APPCLUSTER

these are my implementation details.

After I took URL "http://localhost:8085/hystrix.dashboard". And pasted "http://localhost:8085/turbine.stream?cluster=APPCLUSTER". But getting error like "Unable to connect to Command Metric Stream". Adding screenshots below.

enter image description here

enter image description here

1

There are 1 best solutions below

4
On BEST ANSWER

You need to remove space from comma separated service names

turbine.aggregator.cluster-config=espace-Second_Microservice,espaceFirst_Microservice

You cannot aggregate streams from different cluster names, either use one cluster name in both espace-Second_Microservice and espace-First_Microservice or don't use cluster at all.

To define one cluster name use below config

    eureka:
      instance:
        prefer-ip-address: true
        leaseRenewalIntervalInSeconds: 3
        leaseExpirationDurationInSeconds: 3
        metadata-map:
          cluster: APPCLUSTER

Use below mentioned config for turbine

turbine:
  aggregator:
    clusterConfig: APPCLUSTER
  app-config: espace-Second_Microservice,espace-First_Microservice
  instanceUrlSuffix.APPCLUSTER: /hystrix.stream

Use http://{turbine host}:{turbine Port}/turbine.stream?cluster=APPCLUSTER in Hystrix Dashboard