微服务系统服务跟踪监控-Zipkin配置

7 篇文章 0 订阅
4 篇文章 0 订阅

Springboot 使用2.0版本后相应的Zipkin也需要使用2.0版本的,官方建议直接在服务器使用命令运行Zipkin,Zipkin官网安装说明

1.运行起来后访问http://localhost:9411即可访问到如下界面:

2.然后在项目1中POM文件加入:

<!-- 服务追踪 -->
		<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-zipkin -->
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-zipkin</artifactId>
			<version>2.0.1.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-sleuth -->
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-sleuth</artifactId>
			<version>2.0.1.RELEASE</version>
		</dependency>

然后再项目1的YML文件中加入:

spring:
    zipkin:
        enabled: true
        compression: 
            enabled: true
        discovery-client-enabled: true
        base-url: https://zuultest.bearead.com/zipkin
    sleuth:
        enabled: false
        sampler:
            probability: 1
        trace-id128: true
        web:
            client:
                enabled: true
            enabled: true
        feign:
            enabled: true
            processor:
                enabled: true
        messaging:
            rabbit:
                enabled: true
            enabled: true 
        http:
            enabled:  true
            legacy:
                enabled: true
        zuul:
            enabled: true
        log:
            slf4j:
                enabled: true
        scheduled:
            enabled: true
        hystrix:
            strategy:
                enabled: true

 此时项目1已经完成配置,在配置一个和项目1有交互请求的项目2,项目2配置同上,此时访问项目1由于项目1和项目2有交互查询Zipkin网页监控会发现如下图:

下一篇会介绍怎么让Zipkin使用Mysql存储监控数据,不会因为重启丢失监控数据

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

菠萝-琪琪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值