DOCS / FEATURES
Error tracking
Failures that need a person, such as a 500, a panic or a dead-lettered
job, go to Sentry once each, grouped and tagged with the request id
already in the x-request-id header. A support ticket that quotes the
header leads straight to the issue and its log lines. Logs and traces
stay as they are (Observability). This is the part
that alerts.
Reporting is off until SENTRY_DSN is set, and costs nothing while off.
api/src/reporting/
├── mod.rs # ErrorReporter trait, ErrorReport, NoopReporter,
│ # RecordingReporter, Throttled, the principal slot
├── layer.rs # the tracing layer that reports logged errors
├── middleware.rs # the 500 and panic capture points
├── routes.rs # POST /api/client-errors: the SPA's crash reports
└── sentry.rs # SentryReporter: the only file that imports `sentry`
web/src/lib/
├── crash-report.ts # what a browser report says, and when one is sent
└── report-error.ts # window listeners, reportError, the POST
web/src/ui/ErrorScreen.tsx # the router's error screenWhat is reported
| Source tag | When | Grouped by |
|---|---|---|
http |
A handler returns AppError::Db, Payment or Internal (a 500) |
Message |
panic |
A handler panics. The caller still gets the normal JSON 500 instead of a dropped connection | Message |
job |
A job fails its last attempt and is dead-lettered. Earlier failed attempts are retried and only logged | job:<kind> |
worker |
The job worker can't claim, reap or run scheduled tasks, can't record a job's outcome, or a worker task panics and is restarted | worker:<what> |
client |
The SPA crashed in someone's browser: an uncaught error, an unhandled promise rejection, or an error a route's loader or render threw (see Browser crashes) | Message |
log |
The API logged an error for something that failed nothing else: a best-effort step such as an audit write, a notification, a usage count, a stored-file cleanup, or a scheduled task (a purge, the hourly usage report) | log:<module>:<message> |
[ full guide ]
The rest of this guide comes with the repo.
- What a report carries
- Browser crashes
- How it fits together
- Configuration
- Privacy
- Testing