Skip to content

Issue #74 — End-to-End Correlation-ID Tracing & Sentry Source Maps #643

Description

@Topmatrixmor2014

Thread a correlation ID from the frontend through the backend so any error can be traced end-to-end, and upload source maps so Sentry stack traces point at real code.

Requirements and Context

frontend/lib/correlation.ts, frontend/components/ErrorBoundary.tsx, and the Sentry configs (sentry.client.config.ts, sentry.server.config.ts) exist, but correlation IDs are not consistently propagated through frontend/lib/api.ts to the backend, and release source maps are not uploaded, so production stack traces are minified and untraceable across services.

Objectives

  1. Generate a correlation ID per request and propagate it via a header through api.ts and the SDK.
  2. Log/attach the correlation ID in backend request logging (pino) and error responses so frontend↔backend traces join.
  3. Upload Sentry source maps for production builds and tag releases.
  4. Add tests for correlation-ID propagation and error capture.

Suggested Execution

  1. git checkout -b feat/correlation-tracing.
  2. Wire the header through frontend/lib/api.ts and the backend request middleware.
  3. Configure source-map upload in the frontend build/Sentry configs.
  4. Add frontend/__tests__/correlation.test.ts and run npm run type-check && npm test.

Acceptance Criteria

  • Every frontend API call sends a correlation ID (≥3 tests).
  • Backend logs and error responses include the same ID.
  • Production source maps are uploaded and releases tagged.
  • A simulated error is traceable from frontend capture to backend log.

Guidelines

  • Use the existing correlation.ts and pino request logging; avoid new telemetry deps.
  • Ensure correlation IDs are redacted from any user-facing UI.

Timeframe: 72 hours


Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions