我的springcloudshe版本1.5.8.RELEASE如下:

hystrix-dashboard 是用于监控hystrix的调用情况,但是针对单个hystrix.stream监控

turbine  用于整合多个集群的hystrix.stream,通过turbine.stream对外提供整合数据,这样可以监控集群的hystrix.stream调用

http://localhost:port/hystrix.stream
http://localhost:port/turbine.stream

可以将两个hystrix-dashboard +turbine 合成一个项目节省下

1、配置监控平台

首先配置hystrix-dashboard+turbine  pom.xml

 

   <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.8.RELEASE</version>
    </parent>

    <groupId>com.zhou.demo</groupId>
    <artifactId>hystrix-dashboard</artifactId>
    <version>1.0.0</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Dalston.SR4</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <dependencies>
        <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>
    </dependencies>

启动类

 

@SpringBootApplication
@EnableDiscoveryClient
@EnableTurbine
@EnableHystrixDashboard
public class HystrixDashboardApp {
    public static void main(String[] args) {
        SpringApplication.run(HystrixDashboardApp.class, args);
    }
}

 

配置文件:appConfig 需要拉取hystrix.stream的application-name

 

clusterNameExpression 配置集群name,我配置的是默认,这一块应该和eureka配置放在一起(具体自己尝试)

还有combineHostPort默认是true,用host和post来区分不同的服务

 

turbine:
  appConfig: zuul-server,zuul-inner-server
  clusterNameExpression: new String("default")

如此搭建完成。

 

 

2、如何让应用产生hystrix.stream

 

需要actuator hystrix的相关jar包,需要@EnableCircuitBreaker相关注解

1、网关服务zuul本来就有,不用额外配置

2、使用feign调用的服务,需要打开hystris feign:hystrix:enabled: true

3、非feign的springboot项目,使用resttemple调用服务时,需要以上相关包和相关注解,还需要 @HystrixCommand来使用hystrix来支持。

4、另外需要有调用任意hysrix接口,不然没有hystrix调用,访问hystrix.stream会一直ping,hystrix监控界面一直loading,查看hystrix.stream是没数据。

监控界面监控非网关服务时, Circuit显示具体调用hystrix的类和对应方法,下面的thread pools显示具体的application-name

参数解释

 

更完全的说明解释图如下

3、参考文章

https://mp.weixin.qq.com/s/c4PwWUJiTKdeuxdGGAC8sw  系列文章可看

https://www.jianshu.com/p/b7b20fc09ca9 系列文章,内有代码示例,版本1.5.6可以参考

 

 

 

 



 

 

 

 

GitHub 加速计划 / da / dashboard
14.17 K
4.13 K
下载
General-purpose web UI for Kubernetes clusters
最近提交(Master分支:3 个月前 )
9a476333 Bumps [jest-preset-angular](https://github.com/thymikee/jest-preset-angular) from 14.2.0 to 14.2.2. - [Release notes](https://github.com/thymikee/jest-preset-angular/releases) - [Changelog](https://github.com/thymikee/jest-preset-angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/thymikee/jest-preset-angular/compare/v14.2.0...v14.2.2) --- updated-dependencies: - dependency-name: jest-preset-angular dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 3 个月前
11b7e82e Bumps [cypress](https://github.com/cypress-io/cypress) from 13.13.1 to 13.13.2. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.13.1...v13.13.2) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐