Chapter 5. Instrumentation of Asynchronous Applications
In Chapter 4, Instrumentation Basics with OpenTracing, we reviewed the basics of instrumenting a microservices-based application for distributed tracing using the OpenTracing APIs. If you went through all the exercises, you deserve a medal! The Hello application was intentionally very simple and involved only blocking synchronous calls between microservices.
In this chapter, we will attempt to instrument an online chat application, Tracing Talk, which uses asynchronous messaging-based interactions between microservices built on top of Apache Kafka. We will see how metadata context can be passed through messaging systems using the same OpenTracing primitives we already discussed, and how causal relationships between spans can be modeled differently than in the plain RPC scenarios.
We will continue using the OpenTracing API, even though the same instrumentation principles would apply to other tracing APIs, such as Zipkin's Brave and OpenCensus...