Fix Sentry not instrumenting Express, bump version to 1.10.2 #2

Merged
joshua merged 1 commits from fix/sentry-express-instrumentation-order into main 2026-08-28 13:22:56 +02:00
Owner

Summary

  • Sentry logged [Sentry] express is not instrumented at startup because express/cors/@prisma/client were required at the top of backend/src/index.js, before Sentry.init() ran. Sentry's auto-instrumentation patches those modules via a require hook, which only works if Sentry.init() runs first.
  • Sentry.init() now runs immediately after dotenv.config(), before any Sentry-instrumented library is required.
  • Version bumped to 1.10.2.

Test plan

  • Backend Jest suite (21 tests) passes
  • Booted the backend locally with a test SENTRY_DSN set — confirmed the "not instrumented" warning no longer appears and the server serves requests normally

https://claude.ai/code/session_01CSWFWQsjTc9GyffPiXEDQT

## Summary - Sentry logged `[Sentry] express is not instrumented` at startup because `express`/`cors`/`@prisma/client` were required at the top of `backend/src/index.js`, before `Sentry.init()` ran. Sentry's auto-instrumentation patches those modules via a require hook, which only works if `Sentry.init()` runs first. - `Sentry.init()` now runs immediately after `dotenv.config()`, before any Sentry-instrumented library is required. - Version bumped to 1.10.2. ## Test plan - [x] Backend Jest suite (21 tests) passes - [x] Booted the backend locally with a test `SENTRY_DSN` set — confirmed the "not instrumented" warning no longer appears and the server serves requests normally https://claude.ai/code/session_01CSWFWQsjTc9GyffPiXEDQT
joshua added 1 commit 2026-08-28 13:21:42 +02:00
express, cors, and @prisma/client were required at the top of
backend/src/index.js before Sentry.init() ran, so Sentry's
auto-instrumentation (which patches those modules via a require hook)
missed them — startup logged "[Sentry] express is not instrumented".
Sentry.init() now runs immediately after dotenv.config(), before any
of the libraries it instruments are required.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSWFWQsjTc9GyffPiXEDQT
joshua merged commit 798156efe6 into main 2026-08-28 13:22:56 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joshua/hope-events#2