This demo show you how to leverage OpenTracing and Spring to propagate trace context across process boundaries, achieve method-level tracing and enable tracing for kafka messaging in an Istio service mesh.
- Create a mesh instance at tencent clould mesh.
- Create a TKE cluster, and add this cluster into the mesh that you just created.
- Download this repository:
git clone https://github.com/aeraki-framework/method-level-tracing-with-istio.git
- deploy kafka into the TKE cluster:
kubectl apply -f istio-opentracing-demo/k8s/kafka.yaml
- deploy eshop demo into the TKE cluster:
kubectl apply -f istio-opentracing-demo/k8s/eshop.yaml
- Open this url in the browser to trigger the eshop service: http://${INGRESS_EXTERNAL_IP}/checkout
- Open TCM UI in the browser to view the tracing.
- The eshop demo uses opentracing and Zipkin for distributed tracing instrumentation. All the REST calls are automatically traced by opentracing.
- A 'Traced' AOP annotation is used for method-level tracing instrumentation.
- Zipkin opentracing implementation handles the trace context propagation crossing process boundaries. So we don't have to explicitly copy the tracing headers from downstream requests to upstream requests.
- A TracingKafka2RestTemplateInterceptor is used to propagate trace context from kafka headers to HTTP headers.
More at https://zhaohuabing.com/post/2019-06-22-using-opentracing-with-istio/