We’ll break down why an HTTP service needs a
request_id, how to agree on a mini-contract for the
X-Request-ID header, why a request identifier should be stored in
context.Context, how to correctly choose a key for
context.WithValue, generate an id via
crypto/rand, and how to build middleware that puts request_id into the context and returns it to the client in response headers.