How should I carry a correlation ID from the HTTP request all the way into queued jobs?
Generate the ID as a W3C traceparent, carry it in an SQS message attribute rather than the body, and inject it with the OTel propagator on both sides.
Tag
Structured logging: what to write, what never to write and staying searchable later. questions under this tag, answered directly.
2 answered questions carry this tag.
Generate the ID as a W3C traceparent, carry it in an SQS message attribute rather than the body, and inject it with the OTel propagator on both sides.
Log at ERROR when the line would wake someone at 3am and at WARN when it would not, log a failure once at its boundary, and alert on the ERROR rate.