Description
Every service across the backend logs via NestJS's built-in Logger with free-form string messages (e.g. this.logger.log(\Migration ${name} (${run.runId}) completed`)insrc/migration/migration-runner.service.ts, similar patterns throughout src/gig/, src/dispute/, src/event-ingestion/) — there is no request-scoped correlation/trace ID generated anywhere, and no structured (JSON) log output. src/common/filters/sentry-exception.filter.ts` captures unhandled 5xx errors to Sentry, but there's no way to correlate a given Sentry event with the specific application log lines emitted while handling that same request, since neither carries a shared identifier. In production, tracing a single request's full lifecycle (auth → rate limit → controller → service → webhook dispatch) across logs currently requires guessing based on timestamps and content alone.
Component
Backend
Difficulty
🔴 Hard
Tasks
Acceptance Criteria
Estimated Time
1-2 days
Description
Every service across the backend logs via NestJS's built-in
Loggerwith free-form string messages (e.g.this.logger.log(\Migration ${name} (${run.runId}) completed`)insrc/migration/migration-runner.service.ts, similar patterns throughoutsrc/gig/,src/dispute/,src/event-ingestion/) — there is no request-scoped correlation/trace ID generated anywhere, and no structured (JSON) log output.src/common/filters/sentry-exception.filter.ts` captures unhandled 5xx errors to Sentry, but there's no way to correlate a given Sentry event with the specific application log lines emitted while handling that same request, since neither carries a shared identifier. In production, tracing a single request's full lifecycle (auth → rate limit → controller → service → webhook dispatch) across logs currently requires guessing based on timestamps and content alone.Component
Backend
Difficulty
🔴 Hard
Tasks
X-Request-Idheader as) a correlation ID for every request, attaching it to the request objectLoggercontext (e.g. via NestJS'sAsyncLocalStorageor a request-scoped logger) so every log line emitted while handling a request includes itSentryExceptionFilter(src/common/filters/sentry-exception.filter.ts) so Sentry events can be cross-referenced with application logsAcceptance Criteria
Estimated Time
1-2 days