Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add into Turbine additional Hystrix metrics aggregations

My setup is spring boot cloud using netflix library I managed to have Turbine aggregating Hystrix metrics from one service. However when I add more services I cant see them.

This is my setup (also uploaded this into github at: Project On Github

Service 1:

FlightIntegrationService:

@SpringBootApplication
@EnableCircuitBreaker
@EnableDiscoveryClient
@ComponentScan("com.bootnetflix")
public class FlightIntegrationApplication {
..
}

application.yaml

server:
  port: 0

eureka:
  instance:
    leaseRenewalIntervalInSeconds: 10
    metadataMap:
      instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${random.value}}}
  client:
    registryFetchIntervalSeconds: 5

bootstrap.yaml

spring:
  application:
    name: flight-integration-service

service 2:

Coupon service:

@SpringBootApplication
@EnableCircuitBreaker
@EnableDiscoveryClient
@ComponentScan("com.bootnetflix")
public class CouponServiceApp {
..
}

application yaml:

server:
  port: 0

eureka:
  instance:
    leaseRenewalIntervalInSeconds: 10
    metadataMap:
      instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${random.value}}}
  client:
    registryFetchIntervalSeconds: 5

Eureka app service:

@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication  {



Hystrix dashboard service:

    @SpringBootApplication
    @EnableHystrixDashboard
    @Controller
    public class HystrixDashboardApplication  {

application.yaml:

info:
  component: Hystrix Dashboard

endpoints:
  restart:
    enabled: true
  shutdown:
    enabled: true

server:
  port: 7979

logging:
  level:
    ROOT: INFO
    org.springframework.web: DEBUG

eureka:
  client:
    region: default


    preferSameZone: false

    us-east-1:
      availabilityZones: default

  instance:
    virtualHostName: ${spring.application.name}

bootstrap.yaml

spring:
  application:
    name: hystrixdashboard

and finally Turbine-service:

  EnableAutoConfiguration
    @EnableTurbine
    @EnableEurekaClient
    @EnableHystrixDashboard
    public class TurbineApplication {

application.yaml:

info:
  component: Turbine

PREFIX:

endpoints:
  restart:
    enabled: true
  shutdown:
    enabled: true

server:
  port: 8989

management:
  port: 8990



eureka:
  instance:
    leaseRenewalIntervalInSeconds: 10
  client:
      serviceUrl:
        defaultZone: http://localhost:8761/eureka/



#turbine:
 # aggregator:
  #  clusterConfig: FLIGHT-INTEGRATION-SERVICE,COUPON-SERVICE
  #appConfig: flight-integration-service,coupon-service


#turbine:
#  clusterNameExpression: 'default'
 # appConfig: flight-integration-service,coupon-service

turbine:
  appConfig: coupon-service,flight-integration-service
  clusterNameExpression: new String('default')




#As you can see I tried diff configurations.

What am i doing wrong? why I cant actually aggregate both services hystrix metrics(flight-integration service,coupon-service) Thank you.

like image 323
rayman Avatar asked Jun 01 '15 19:06

rayman


People also ask

How do I add dependency to Hystrix?

First, we need to add the Spring Cloud Starter Hystrix dependency in our build configuration file. Now, add the @EnableHystrix annotation into your main Spring Boot application class file. The @EnableHystrix annotation is used to enable the Hystrix functionalities into your Spring Boot application.

What is turbine in Hystrix?

Turbine is an application that aggregates all of the relevant /hystrix. stream endpoints into a combined /turbine. stream for use in the Hystrix Dashboard. Individual instances are located through Eureka.

How do I configure hystrix dashboard?

To enable Hystrix dashboard, we only have to annotate our spring boot main class with @EnableHystrixDashboard . Following is the dependency information of Hystrix project. The Hystrix dashboard is avialable at http://localhost:9090/hystrix for client-service instance in our case.

Which artifact is used to include hystrix in your project?

3.1 How to Include Hystrix To include Hystrix in your project, use the starter with a group ID of org. springframework. cloud and a artifact ID of spring-cloud-starter-netflix-hystrix .


1 Answers

solved by @spencergibb suggestation. I added to each of the client the dependency of spring-boot-starter-amqp and created rabbitMQ broker. Turbine is aggregating all messages via amqp and I was able to see all Hystrix commands aggregated on my hystrix dashboard server

like image 64
rayman Avatar answered Oct 25 '22 21:10

rayman