zipkin搭建可參照官方提供的https://github.com/openzipkin/zipkin/tree/master/zipkin-serverhtml
基於spring boot,jdk8java
默認是存儲在內存中,支持mysql、Cassandra 等數據庫mysql
在生產環境中,因爲日誌量比較大,沒必要全部請求都採集,可控制採集的速率,在brave中設置git
@Bean
public Brave brave(SpanCollector spanCollector){
Brave.Builder builder = new Brave.Builder(properties.getServiceName()); //指定state
builder.spanCollector(spanCollector);
builder.traceSampler(Sampler.create(0.5f));
Brave brave = builder.build();
return brave;
}github
日誌量就不會太大,又達到咱們檢查鏈路日誌的要求spring
參考資料有sql
http://www.cnblogs.com/java-zhao/p/5858138.html數據庫
https://github.com/liaokailin/zipkinui