Skip to content

[Enhancement] Error monitoring uses console.error only — no Sentry or structured error tracking #763

Description

@RUKAYAT-CODER

Overview

src/lib/errors/index.ts contains a TODO comment to replace console.error with a Sentry integration. In production, unhandled errors are only visible in server logs — there is no alerting, grouping, user-impact counting, or stack-trace deduplication. This makes incident response entirely reactive and manual.

Specifications

Features:

  • Unhandled errors are reported to Sentry with full context (user ID, request path, environment)
  • Repeated errors are deduplicated and grouped
  • Critical errors trigger alerts

Tasks:

  • Install @sentry/nextjs and run the Sentry wizard
  • Configure Sentry DSN via SENTRY_DSN environment variable
  • Replace console.error calls in src/lib/errors/index.ts with Sentry.captureException()
  • Add user context: Sentry.setUser({ id: userId })
  • Add sentry.server.config.ts and sentry.client.config.ts

Impacted Files:

  • src/lib/errors/index.ts
  • src/app/error.tsx
  • src/app/global-error.tsx
  • .env.example

Acceptance Criteria

  • Errors captured by error.tsx appear in the Sentry dashboard
  • SENTRY_DSN is documented in .env.example
  • No console.error calls remain for exception tracking in production paths

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions