14

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

Mr.DevEng
  • 2,651
  • 14
  • 57
  • 115
  • Are you pointing turbine to a hystrix.stream? Has the code path that has a circuit breaker been exercised? – spencergibb Dec 05 '17 at 18:11
  • I already implemented my service with hystrix.After that I am trying to aggregate monitoring using turbine.so in hystrix dashboard page I am trying to get turbine.stream..service and turbine project are separate. And in service I implemented circuit breaker – Mr.DevEng Dec 05 '17 at 19:40

1 Answers1

0

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

Prateek Shrivastava
  • 450
  • 2
  • 5
  • 17
  • Yes.I modified according to above. But still getting error in screen that "Unable to connect to Command Metric Stream". And also sorry for late reply.I am modifying code.Can you please look on above – Mr.DevEng Jan 08 '18 at 14:59
  • You are mixing configuration for yaml file and properties file. You need to define configuration in properties file format if you are using .properties file – Prateek Shrivastava Jan 09 '18 at 16:18
  • eureka.instance.preferIpAddress=true eureka.instance.leaseRenewalIntervalInSeconds=3 eureka.instance.leaseExpirationDurationInSeconds=3 eureka.instance.metadataMap.cluster=APPCLUSTER – Prateek Shrivastava Jan 09 '18 at 16:19
  • @PrateekShrivastava - Could you please guide me here: https://stackoverflow.com/questions/61431036/spring-boot-v2-2-6-release-and-turbine-unable-to-aggregate-the-metrix ? – PAA Apr 25 '20 at 19:05