Tips for Spring Cloud Sleuth and Zipkin
Versions
- Spring Cloud: 2.0.1.RELEASE
- Spring Boot: 2.0.3.RELEASE
Related dependencies
1 |
|
Problem and Solution
Dependencies config
The artifict spring-cloud-starter-zipkin already contains the “spring-cloud-starter-sleuth” and “spring-cloud-sleuth-zipkin”, so no need config again.
Sleuth log showing false
If the console log show “false” like below, that’s means the spans are not sending from Sleuth to Zipkin.
1 |
|
It mostly due to “probability” setting for sampler, if debug in local we can set sampler.probality to 1.0 (all traces)
1 |
|
After above configuration, the log should shows “true” like
1 |
|
Console shows sending to Zipkin, but no trace in Zipkin
May encounter the problem the Sleuth shows sending spans to Zipkin, but we cannot found the trace from Zipkin portal.
Add zipkin.sender.type to web, will solve this problem.
1 |
|
Offical document about this config:
1 |
|