2015-06-01 6 views
8

मेरा सेटअप नेटफ्लिक्स लाइब्रेरी का उपयोग कर वसंत बूट क्लाउड है, मैं एक सेवा से टर्बाइन समेकित हाइस्ट्रिक्स मेट्रिक्स प्राप्त करने में कामयाब रहा। हालांकि जब मैं और सेवाएं जोड़ता हूं तो मैं उन्हें नहीं देख सकता।टर्बाइन अतिरिक्त हाइस्ट्रिक्स मेट्रिक्स समेकन में कैसे जोड़ें

यह मेरा सेटअप (भी पर GitHub में इस अपलोड की गई है: Project On Github

सेवा 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 

सेवा 2:

कूपन सेवा:

@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 

यूरेका एप्लिकेशन सेवा:

@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 

और अंत में टर्बाइन सेवा:

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. 

क्या मैं गलत कर रहा हूँ? मैं वास्तव में दोनों सेवाओं को हिस्ट्रिक्स मेट्रिक्स (उड़ान-एकीकरण सेवा, कूपन-सेवा) को एकत्रित नहीं कर सकता हूं धन्यवाद।

+0

पर समेकित सभी हाइस्ट्रिक्स कमांड देख सकता था। क्या आपने turbine.aggregator के साथ अनुभाग को असम्बद्ध करने का प्रयास किया है, फिर '? क्लस्टर = FLIGHT-INTEGRATION-SERVICE' या ' क्लस्टर = कूपन-सेवा 'टर्बाइन यूआरएल को आपने हाइस्ट्रिक्स डैशबोर्ड में रखा है? – spencergibb

+0

लेकिन यदि मैं एक समय में एक सेवा एकत्र करने की तुलना में लाइट-इंटेग्रेशन-सेवा या क्लस्टर = कूपन-सेवा जोड़ता हूं। मैं टर्बाइन पर सभी सेवाओं को एक साथ देखना चाहता हूं। – rayman

+0

यह नहीं है कि डिफ़ॉल्ट रूप से टरबाइन कैसे बनाया जाता है। वसंत-क्लाउड-नेटफ्लिक्स-टरबाइन-एएमपीपी सभी सेवाओं को जोड़ता है। https://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-turbine-amqp – spencergibb

उत्तर

3

@spencergibb सुझाव द्वारा हल किया गया। मैंने प्रत्येक ग्राहक को वसंत-बूट-स्टार्टर-एएमक्यूपी की निर्भरता में जोड़ा और खरगोश एमक्यू ब्रोकर बनाया। टर्बाइन amqp के माध्यम से सभी संदेशों को एकत्रित कर रहा है और मैं अपने हाइस्ट्रिक्स डैशबोर्ड सर्वर

+0

क्या आप कृपया अपने कामकाजी कोड नमूना को जिथब में साझा कर सकते हैं ... मैं भी हूं एक ही समस्या का अनुभव ... – PKumar

+0

https://github.com/IdanFridman?tab=activity पर मेरे github खाते की जांच करें – rayman

संबंधित मुद्दे