安装配置
zipkin demo测试(https://github.com/openzipkin/sleuth-webmvc-example)
进入测试目录(webmvc25 webmvc3 or webmvc4),启动web程序
$ mvn jetty:run -Pfrontend
$ mvn jetty:run -Pbackend
下载zipkin jar包
curl -sSL https://zipkin.io/quickstart.sh | bash -s
启动zipkin服务:
java -jar zipkin.jar
本地访问:curl -s localhost:8081 -H'user-name: JC'
,通过zipkin查看请求信息:zipkin服务的默认端口为9411,所以通过浏览器访问http://localhost:9411/zipkin/
来查看
通过zipkin源码(https://github.com/openzipkin/zipkin)启动服务:
# get the latest source
git clone https://github.com/openzipkin/zipkin
cd zipkin
# Build the server and also make its dependencies
./mvnw -DskipTests --also-make -pl zipkin-server clean install
# Run the server
java -jar ./zipkin-server/target/zipkin-server-*exec.jar
开发
zipkin的模块组成:
collector:
storage:存储功能以插件的形式存在,现有Cassandra,ES,Mysql,另外可通过第三方扩展来提供其他存储支持.
query:提供查询接口,查询结果以json格式给出
UI:页面
在brave(https://github.com/openzipkin/brave)中包含了各个java应用中使用zipkin的实例,如果需要在自己的java程序中使用zipkin,可以参考brave中给出的示例代码做二次开发.