Appendix B. Context Propagation in OpenTelemetry
In Chapter 14 we discussed context propagation as it applies not only to distributed tracing, but also to other applications in microservice architectures. As of this writing, OpenTelemetry has adopted a proposal to separate its context mechanism and model from the distributed tracing and metric models to support a wider variety of use cases. As the exact translation of this proposal into specification has not occurred at this point, we’ll describe the overarching goals of this context propagation model, how it factors into the overall OpenTelemetry project, and its intended use.
Why a Separate Context Model?
Earlier in the book we discussed the advantages of context propagation as a mechanism that applies to use cases beyond simply profiling and monitoring microservice architectures, also known as cross-cutting tools. Today, the practical realities of how developers build software has meant that these cross-cutting tools are often tightly coupled to some other particular component or dependency in their software. An example of this is in OpenTracing—the ability to propagate key-value pairs through trace context baggage is quite useful for passing messages around an application for telemetry purposes (for example, using data carried in the baggage from an upstream service to isolate a particular event or metric later in the request), but we have also seen usages of it where developers use it as an out-of-band message channel to ...
Get Distributed Tracing in Practice now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.