Developer finds Sentry blind for months as 18 of 19 routes skipped error reporting
The backend service powering K-XpertAI, an AI coding assistant built by KingxTech, had Sentry correctly configured with a valid DSN yet reported zero errors and zero transactions for months. An investigation revealed that only one of nineteen routes called Sentry.captureException(), while the remaining 18 silently logged errors to stdout via console.error() and returned clean JSON responses to users. This meant real production failures — including failed Paystack checkouts, broken GitHub pushes, and corrupted sessions — were completely invisible to the monitoring dashboard. The fix was centralized rather than applied route by route: a shared handleFsError() helper was updated to cover 13 routes at once, and a new reportError() helper addressed the remaining five. A mandatory Sentry.flush() call was also added before responses are sent, preventing Google Cloud Run from dropping async error events when containers are frozen after request completion.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in