me

fix(logging): standardize request-id propagation across services #1487

Open

octodev wants to merge 5 commits into main from fix/request-id-propagation

octodev commented on Jun 22, 2026
Author

Request IDs were being generated inconsistently across our services, making it painful to trace a single user request from the web client through the API gateway into the billing worker. Some services used x-correlation-id, others used x-request-id, and the billing worker generated its own.

What changed

  • Standardize on the x-request-id header everywhere.
  • Forward the incoming header through requestContext middleware instead of always minting a fresh ULID.
  • Log under the unified requestId key so Datadog filters work across services.

Test plan

  • Unit tests for requestContext middleware
  • Manual trace from web → api → billing worker
  • Verify Datadog dashboard once deployed to staging
curl -H "x-request-id: test-123" https://api.atlas.local/v1/ping
# logs: { "requestId": "test-123", ... } in all three services

Closes #1402 Refs #1390

octodev added the observability and bug labels · Jun 22, 2026

octodev requested review from alice-w and marco-d · Jun 22, 2026

alice-w approved these changes · 2 hours ago

All checks have passed4 successful, 1 skipped checks
This branch has no conflicts with the base branch

Merging can be performed automatically.