Observability¶
Effectively none.
What exists¶
console.log/console.errorcalls inAuthContext.tsx(login flow, debug logs)console.error(\API ${method} request failed:`, error)inapi.ts`- Toasts to the user via
sonnerand shadcntoast
What does not exist¶
| Capability | Status |
|---|---|
| Error tracker (Sentry, Bugsnag, Rollbar) | ❌ |
| Real User Monitoring (Sentry RUM, Datadog RUM, SpeedCurve) | ❌ |
| Analytics (GA, Mixpanel, Amplitude, Segment) | ❌ |
| Console-log scrubbing for production | ❌ — console.log("login - extracted user:", user) ships to prod with sensitive PII |
| Source-map upload to an error tracker | ❌ |
| Session replay (FullStory, LogRocket) | ❌ |
| Web Vitals reporting | ❌ |
| Feature flag system | ❌ |
Specific concerns¶
console.logis left in production.AuthContext.tsxhas lines likeconsole.log("login - extracted user:", user)that fire on every login. PII in console (visible to anyone with devtools, but also potentially captured by any browser extension the user has installed) is a moderate exposure.-
Fix: a tiny
loggerwrapper that no-ops in production, plus a Vite build-time replacer (drop_consolein esbuild config) to strip residual ones. -
No source-map upload. If the team eventually adds Sentry, the production minified stack traces will be unreadable without source-map upload at build time.
-
No correlation with backend logs. The FE doesn't propagate a request id; the BE doesn't issue one. Reconstructing a user's session across FE + BE logs is impossible without both ends emitting a shared id.
-
No usage telemetry. The team has no data on which admin features are actually used. If
/promptsis unused (which is consistent with the route being hidden from the sidebar), no one knows for sure.
Minimal improvements (in cost order)¶
- Strip
console.login production —vite.config.ts: - Add
web-vitals— 5-line integration to report LCP/INP/CLS to any backend endpoint. - Add a feature-flag library (e.g., Statsig SDK, ~10 lines) so the team can ship dark — relevant if/when the admin tool grows.
- Add Sentry —
@sentry/reactSDK withBrowserTracing+ source-map upload step in CI. ~30 minutes of setup. - Add an analytics SDK — only if the team will actually use the data. Otherwise it's data theatre.
Recommendations¶
For a 10-50 user admin tool, the cost/benefit of full observability is low. Priority should be:
- Strip
console.log(this week) - Add Sentry (next sprint) — catches the next regression before users complain
- Add Web Vitals (next sprint) — cheap, no downside
- Defer analytics until there's a concrete decision riding on usage data
The platform-wide observability gap is larger; addressing it here first is reasonable (low traffic, internal users tolerate breakage during instrumentation).