Summary
In this chapter, we covered the more advanced topic of tracing instrumentation for asynchronous applications. Using Apache Kafka as an example of asynchronous communication between services, we discussed how tracing context can be propagated through messaging infrastructure, and how producer and consumer spans are created at both ends of the message bus. We finished off with a discussion about instrumenting applications that use asynchronous programming in-process, such as futures and executors in Java. While the instrumentation itself was OpenTracing-specific, the principles of instrumenting asynchronous applications were general and applicable to any tracing API built around the span model.
Most of the instrumentation we used in this chapter came from various off-the-shelf open source modules from the opentracing-contrib
organization on GitHub. We even avoided the code to instantiate the Jaeger tracer and used runtime configuration options instead. Since all the instrumentation...