Skip to content

feat(#260): add correlation ID propagation for request tracing - #320

Open
Ebuka042-pixel wants to merge 1 commit into
Pidoko257:mainfrom
Ebuka042-pixel:feat/issue-260-correlation-id
Open

feat(#260): add correlation ID propagation for request tracing#320
Ebuka042-pixel wants to merge 1 commit into
Pidoko257:mainfrom
Ebuka042-pixel:feat/issue-260-correlation-id

Conversation

@Ebuka042-pixel

Copy link
Copy Markdown
  • Add correlationIdMiddleware that resolves/generates a correlation ID from x-correlation-id > x-trace-id > x-request-id > new UUID
  • Attach req.correlationId and req.log (child logger) to every request
  • Echo X-Correlation-ID response header back to callers
  • Update queue/trace.ts to also propagate correlationId from req object
  • Update logger middleware to prefer correlationId over raw trace headers
  • Extend Express Request type with correlationId and log fields
  • Wire middleware into index.ts immediately after requestId
  • Add unit tests covering header priority, deduplication, and UUID generation
  • Update .gitignore to exclude snapshots, scratch, .pull_request, pacts

Description

Brief description of changes.

Related Issue

Fixes #(issue number)

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring
  • Performance improvement

Changes Made

Testing

How did you test these changes?

Checklist

  • Code follows project style
  • Self-reviewed my code
  • Commented complex code
  • Updated documentation
  • No new warnings
  • Added tests (if applicable)

Screenshots (if applicable)

Additional Notes

closes #260

- Add correlationIdMiddleware that resolves/generates a correlation ID
  from x-correlation-id > x-trace-id > x-request-id > new UUID
- Attach req.correlationId and req.log (child logger) to every request
- Echo X-Correlation-ID response header back to callers
- Update queue/trace.ts to also propagate correlationId from req object
- Update logger middleware to prefer correlationId over raw trace headers
- Extend Express Request type with correlationId and log fields
- Wire middleware into index.ts immediately after requestId
- Add unit tests covering header priority, deduplication, and UUID generation
- Update .gitignore to exclude snapshots, scratch, .pull_request, pacts
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Ebuka042-pixel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add Correlation ID Propagation for Request Tracing

1 participant