What is zipkin?: one explanation
Couple of spring boot services with silly names: butcher, baker, candlestickmaker and kitchenhand.
Made a sandwich in docker using:
- mvn clean package
- docker-compose up
- curl -XPOST localhost:8080/sandwiches
Look at zipkin trace by visiting http://localhost:9411. Grab a trace ID from the docker logs. Eg 6fe09cac9d9b37d3 in:
kitchenhand_1 | 2017-02-26 04:49:32.757 INFO [kitchenhand,6fe09cac9d9b37d3,6fe09cac9d9b37d3,true] 1 --- [readScheduler-2] c.e.k.controller.SandwichController : Collecting ham
Compare with curl -XPOST localhost:8080/sandwiches?turbo=true (tip: it's not actually much faster)
The communication paths between the services:
A trace of the purely sequential flow (curl -XPOST localhost:8080/sandwiches):
A trace of with concurrent HTTP calls from RxJava (curl -XPOST localhost:8080/sandwiches?turbo=true):
See how the containers are connected using weave scope:
sudo curl -L git.io/scope -o /usr/local/bin/scope
sudo chmod a+x /usr/local/bin/scope
scope launch
open http://localhost:4040
https://github.com/spring-cloud/spring-cloud-sleuth
Collecting traces Use https://github.com/openzipkin/zipkin/tree/master/zipkin-server
wget -O zipkin.jar 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec'
java -jar zipkin.jar
https://github.com/openzipkin/docker-zipkin
- https://github.com/openzipkin/zipkin-aws
- Converting a trace into plantuml sequence diagram
- Try spring 5 and webflux
- Put each service in an alpine docker container, start them all using docker compose