Skip to content

feat: add request correlation skill - #18

Merged
robhowley merged 3 commits into
mainfrom
req-correl
Mar 16, 2026
Merged

feat: add request correlation skill#18
robhowley merged 3 commits into
mainfrom
req-correl

Conversation

@robhowley

@robhowley robhowley commented Mar 16, 2026

Copy link
Copy Markdown
Owner
  • Every request or job must produce a traceable log story with a single correlation ID
  • Store correlation in contextvars — never on request objects or as function arguments
  • Wire correlation at every entrypoint — HTTP middleware, job workers, and CLI tasks
  • Read x-request-id from inbound requests; generate one if absent
  • Echo the correlation ID back on the response via x-request-id
  • Inject correlation into every log record automatically via a logging filter
  • Log exceptions exactly once at system boundaries — services raise, they don't log
  • Propagate correlation to all outbound HTTP calls via request headers
  • Propagate correlation explicitly to background jobs — pass it, don't assume inheritance
  • Use copy_context() when spawning async tasks; never assume context is inherited across boundaries
  • Centralize all correlation infrastructure in app/observability/ — never duplicate it
  • Never log secrets, tokens, auth headers, or session IDs

@robhowley
robhowley merged commit f660abf into main Mar 16, 2026
3 checks passed
@robhowley
robhowley deleted the req-correl branch March 16, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant