使用spring-cloud-sleuth-zipkin追踪服务链

一、zipkin服务器配置

新建一个Springboot工程,POM文件主要内容:

1、Springcloud信息    

        <parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.10.RELEASE</version>
	</parent>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>Edgware.SR3</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

2、zipkin服务器信息

        <dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
	            <groupId>io.zipkin.java</groupId>
	            <artifactId>zipkin-server</artifactId>
	        </dependency>
	        <dependency>
	            <groupId>io.zipkin.java</groupId>
	            <artifactId>zipkin-autoconfigure-ui</artifactId>
	        </dependency>
	</dependencies>

3、Application主类信息

添加注解@EnableZipkinServer

4、application.yml配置文件信息

spring:
  application:
    name: zipkin-server
server:
  port: 9411

5、部署

192.168.1.203:9411

6、访问

http://192.168.1.203:9411

二、zipkin客户端配置

1、pom文件添加zipkin支持

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>

2、application.yml配置文件信息

spring:
    zipkin:
        base-url: http://192.168.1.203:9411


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值