The sample guestbook application shows how a Spring Java application can be configured to collect trace spans using Zipkin or Jaeger.
Although Istio proxies are able to automatically send spans, it needs help from the application to tie together the entire trace. To do this applications need to propagate the appropriate HTTP headers so that when the proxies send span information to Zipkin or Jaeger, the spans can be correlated correctly into a single trace.
To do this the guestbook application collects and propagate the following headers from the incoming request to any outgoing requests:
x-request-id
x-b3-traceid
x-b3-spanid
x-b3-parentspanid
x-b3-sampled
x-b3-flags
x-ot-span-context
This is done with the Spring Istio Support written by Ray Tsang:
Generate a small load to the application either using wrk2 or a shell script:
With shell script:
while sleep 0.5; do curl http://$INGRESS_IP/echo/universe -A mobile; done
Or, with wrk2:
docker pull saturnism/wrk2
docker run -ti --rm saturnism/wrk2 \
-d 5s R 5 http://$INGRESS_IP/hello/world
Establish port forward from local port:
kubectl port-forward -n istio-system \
$(kubectl get pod -n istio-system -l app=zipkin -o jsonpath='{.items[0].metadata.name}') \
9411:9411
f you are in Cloud Shell, you'll need to use Web Preview and Change Port to 9411
. Else, browse to http://localhost:9411