0012. Sentry for error monitoring, with releases and source maps from CI
Generated from front/docs/adr/0012-sentry-error-monitoring.md
- Status: Accepted (retroactive)
- Date: 2021-11-18
Context and Problem Statement
Section titled “Context and Problem Statement”The demo runs on many customer/stage deployments; front-end errors are otherwise invisible.
Considered Options
Section titled “Considered Options”Not recorded. (@sentry/react was already listed in the pre-restart package.json.)
Decision Outcome
Section titled “Decision Outcome”@sentry/react is initialised in src/sentry.ts when a DSN is configured and the host is
not localhost. DSN, release and environment come from window.VITE_APP_SENTRY* (runtime,
0009) or build env. Since the Vite
migration, @sentry/vite-plugin uploads source maps when SENTRY_AUTH_TOKEN is set, and
the Docker workflows create a Sentry release front@<tag> (org escolasoft, project
wellms-front); the PHP injector derives the release from version.html. Browser tracing
and session replay integrations are enabled. SDK upgraded to v8 in 2024-11.
Consequences
Section titled “Consequences”- Good: errors are attributable to a released version with readable stack traces.
- Bad: session replay and tracing send user data to a third party; needs to be covered by the deployment’s privacy policy.
Evidence
Section titled “Evidence”5c38a2b22021-11-18 “sentry (#117)” -front/src/sentry.ts56109b242021-11-19 “sentry stage”055ea1812024-11-18 “updating sentry package (#509)”;d572468a2025-01-03 “sentry update (#537)”- current:
front/vite.config.mjs(sentryVitePlugin),front/.github/workflows/docker_build*.yml(getsentry/action-release)