Correlation id
A correlation id is an identifier shared by different steps of the same process. Is very used to related different logs of the same execution -specially for distributed tasks.
As the correlation id must be generated before the actual request is logged, it uses to be a hash of something time-related, like a microtime or an uuid.
Examples
- Log 1: "Availability request" correlation_id = 768uiaysduhi67
- Log 2: "Availability request to provider 1" correlation_id = 768uiaysduhi67
- Log 3: "A log that has nothing to be" correlation_id = 874oiljksdadd
- Log 4: "Availability request to provider 2" correlation_id = 768uiaysduhi67
- Log 5: "A log that has nothing to be" correlation_id = 874oiljksdadd
- Log 6: "Availability request to provider 3" correlation_id = 768uiaysduhi67
- Log 7: "Availability request to provider 4" correlation_id = 768uiaysduhi67
- Log 8: "A log that has nothing to be" correlation_id = 874oiljksdadd
- Log 9: "Availability request to provider 5" correlation_id = 768uiaysduhi67
- Log 10: "Availability response" correlation_id = 768uiaysduhi67
If you take logs with correlation_id = 768uiaysduhi67 you'll be able to take the full request of availability, including external calls to providers.
Back to the glossary