One request id, on every log line, across every service
Generate it at the edge if the client did not send one, put it in a header, log it on every line, pass it to every downstream call.
const requestId = req.headers.get("x-request-id") ?? crypto.randomUUID();
logger = logger.child({ requestId });
await fetch(url, { headers: { "x-request-id": requestId } });Then "what happened to request 8f2a" is one search across every service's logs. Without it, it is a guess.
observability