p1-observability-logging

readytype/backlog

Backlog: Observability — error tracking, structured logging, uptime monitoring

TL;DR

Sentry (Next.js SDK) is wired in the app (2026-05-15). Uptime checks, structured logging, and cron/Sentry monitors are still missing. Full stack is still required for a credible SLA.

Progress

  • 2026-05-15 — Sentry SDK + env in application repo; confirm prod receives server + browser events (test issue) before calling error tracking “done”.

Description

  • Error tracking: Sentry (Next.js SDK) for client + server runtime errors. Free tier sufficient at MVP volume.
  • Structured logging: replace console.log calls in API routes with a logger (pino or built-in console with structured JSON) that Vercel can index.
  • Uptime monitoring: Better Stack / UptimeRobot pinging homepage + /api/admin/waha/health + key admin endpoint. Alert via WhatsApp + email.
  • Cron health: Sentry cron monitors or dead-man-switch on each scheduled job — see p0 — cron reminders.

Acceptance Criteria

  • Sentry receiving server + client events from prod.
  • Uptime monitor configured for at least 3 endpoints.
  • Alert delivered to mg's WA when a synthetic 5xx is triggered.
  • Cron monitors green for 7 consecutive days.
  • In context/system-overview updated with monitoring section.

Priority

  • Priority: p1
  • Rationale: prerequisite for SLA, but not actively breaking users today.

Dependencies

Links

  • [[Projects/aksara-karir/context/system-overview|System overview]]
  • [[Projects/aksara-karir/changelog/2026-05-15-sentry-setup|Changelog — Sentry setup (2026-05-15)]]