async context propagation
Carrying information about the current task, such as which request it serves, across every asynchronous step it takes.
In more detail
In Node.js, AsyncLocalStorage does it by restoring the right store whenever a callback or continuation runs. Distributed tracing extends the same idea across services by sending trace IDs in headers.
Related terms
- AsyncLocalStorage — A Node.js class that keeps a value, such as the current request's ID, available to every function called during one asynchronous operation, without passing it as an argument.
- distributed tracing — Following one request across every service, queue and database it touches by recording linked spans that share a trace identifier.
- correlation ID — A unique value attached to one request and passed along everywhere it goes, so its logs and traces can be found together.
Taught in
- Routing & Middleware: Path Parsing & Async Context — Node.js Internals & Backend Services