Correlation ID
A correlation ID, also called a request ID, is a unique identifier assigned to a request at its entry point and passed along to every service, queue and job that handles it. Each service writes the ID into its logs and responses. Searching for that one value then returns the whole story of the request across the system.
How it works
The gateway or first service generates an ID, such as a UUID, unless the caller already sent one. It forwards the ID in a header, for example X-Request-ID, and adds it to message metadata for async work. Every log line includes it as a field. If a checkout request passes through 4 services, one search for request_id = 7f3a9c returns all 12 log lines it produced, in order. With OpenTelemetry, the W3C traceparent trace ID, 32 hex characters, plays the same role and also links the distributed trace.
Why it matters in production
Without a shared ID, debugging one failed request means matching timestamps across services by hand. Returning the ID to the client lets support quote it in a ticket, so engineers jump straight to the exact logs and trace.
See also
On the One2N blog
Further reading
