1 Star 0 Fork 0

zhangli002 / springcloud-sleuth-samples

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

#springcloud-sleuth-samples
客户端 http://localhost:4444
服务端 http://localhost:2222

##启动zipkin server
启动server命令
1.存内存,启用kafka收集器 java -jar zipkin-server-2.11.4-exec.jar --KAFKA_BOOTSTRAP_SERVERS=127.0.0.1:9092

2.存本地mysql,启用kafka收集器 java -jar zipkin-server-2.11.4-exec.jar --KAFKA_BOOTSTRAP_SERVERS=127.0.0.1:9092 --STORAGE_TYPE=mysql --MYSQL_HOST=localhost --MYSQL_TCP_PORT=3306 --MYSQL_USER=root --MYSQL_PASS=123456

##zipkin span tag中加入业务标志,以便在界面查询 1.注入Tracer bean
@Autowired Tracer tracer;
2.加tag,整个trace中只要有一个span的tag包含某个key,就可以根据该key查询到trace
tracer.currentSpan().tag("empNo", empNo);
3.示范见msa-demo-sleuth-client的SleuthClientService.java

##在调研链路中传入自定义数据 1.客户端
ExtraFieldPropagation.set("key1", val);
2.服务端
String val = ExtraFieldPropagation.get("key1");
System.out.println(val);
3.示例
xx-stream

Comments ( 0 )

Sign in for post a comment

About

Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
Java
1
https://gitee.com/zhangli002/springcloud-sleuth-samples.git
git@gitee.com:zhangli002/springcloud-sleuth-samples.git
zhangli002
springcloud-sleuth-samples
springcloud-sleuth-samples
master

Search