Skip to main content

Context Propagation

Signadot makes use of header-based context to isolate request flows from one another. This header-based context consists of one of several well-known header names and a value, called Routing Key. The routing key is used for making routing decisions during request routing.

Context propagation is a mechanism for propagating information from request to request amongst a set of interacting microservices. This commonly requires either adding a library to your microservice that performs this context propagation automatically, or manual instrumentation to ensure that specific headers on the incoming request are carried over as-is to the outgoing request from that service.

However, there are several mechanisms available that allow adding context propagation to a service in a standardized manner. One preferred way to accomplish this is instrumentation using OpenTelemetry, which originated in distributed tracing. Sandboxes do not require any tracing or trace collection to be implemented. OpenTelemetry simply provides a convenient set of libraries that can take care of propagating the request context for us across the services automatically.

In some languages such as Java and Node.js, instrumentation may be completely automatic with a drop-in library while others may require some code changes.

note

Context propagation cannot be done for you automatically by a service mesh and must be done at the application layer because it is not generally possible to correlate an incoming request into a service to an outgoing request from the service by observing it externally.

With context propagation in place, requests to hosted endpoints will carry the context across arbitrary request topologies, making the effects of changes in the sandbox visible from any service in the system when an identifying header is added to the request.