Observability

Log Correlation ID Guide

Carry correlation and trace identifiers across APIs, queues and workers so one incident can be followed without logging sensitive payloads. Last updated September 17, 2026.

Carry correlation and trace identifiers across APIs, queues and workers so one incident can be followed without logging sensitive payloads. This reference is written for developers who need practical validation behavior, reviewable rules and safe examples rather than copied snippets with no explanation.

Recommended workflow

StepWhy it matters
Choose identifiersUse trace IDs for distributed work and a separate business operation ID when needed.
Validate inbound valuesBound length and characters before copying caller IDs into logs.
Propagate every boundaryForward context through HTTP clients, messages, scheduled jobs and retries.
Query consistentlyKeep one field name and format across services.

Starter snippet

accept safe request id -> create when absent -> propagate -> log structured field -> return response header

Review checks

Common mistakes

Validation should help users correct input while protecting systems from bad data. Keep syntax checks, product policy, security review and deliverability checks separate.

Related Formalint references

Continue with Api Correlation Id Logging Guide, Structured Logging Guide, OpenTelemetry Trace Debugging.