我的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
10
2
下载
General-purpose web UI for Kubernetes clusters
最近提交(Master分支:3 个月前 )
49406263 * chore(chart): release 7.14.0 * chore(code): fix lint * chore(go): bump Go version to 1.24.0 and update module dependencies * chore(go): update used go version to 1.24.0 * chore(docker): update base image to golang:1.24-alpine3.22 across all Dockerfiles 1 个月前
7bb09004 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.2 to 5.5.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5.4.2...v5.5.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.5.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1 个月前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐