A request that crosses several services can create separate log entries with no obvious relationship. A correlation identifier provides a shared reference for tracing that one operation across its path.
Create and propagate the identifier
- Generate an identifier at a trusted boundary or validate one from an upstream service.
- Pass it through downstream requests and include it as a structured log field.
- Return it to the caller when useful so support can connect a report to server-side events.
Keep logs safe and searchable
Use a consistent field name and avoid embedding the ID into free-form text. Do not use a correlation ID as a user identity, authorization token, or place to store personal data.
Set retention and access controls for the log system, and test that the same request ID appears across the expected services. IDs help locate events; they do not replace metrics or distributed traces.
