Skip to content
Docs
Changelog

Error reporting to a self-hosted tracker, off until a DSN is set

packages/error-reporting sends scrubbed errors from the Worker, the browser and the Expo app to a Sentry-compatible tracker; deploy/error-tracker runs Rustrak in Docker behind a Cloudflare Tunnel.

Markdown

  • One package for every runtime. packages/error-reporting configures Sentry's SDKs for the Worker (withErrorReporting around fetch and scheduled), the browser and the Expo app, each off until its DSN is set (ERROR_REPORTING_DSN, VITE_ERROR_REPORTING_DSN, EXPO_PUBLIC_ERROR_REPORTING_DSN). Every event passes one scrubber: e-mails, credentials, td_/mr_/sk_/pk_ tokens and CPFs are redacted, URLs lose their query, only a short header list stays, the user is just an id, and a project's health keys go at any depth. Sentry v11's permissive defaults are replaced by a restricted dataCollection, and pnpm lint fails on an @sentry/* import anywhere else. /api/rpc reports unexpected failures with their request ID, and a browser error after a failed API call carries that call's x-request-id. See error reporting. (0269751)
  • Nothing before the first paint. The browser SDK (33 KB gzip) loads after hydration; until then a few hundred bytes keep uncaught errors. The Worker imports its SDK on the first request only when reporting is on. With no DSN the startup chunks grow by 808 bytes gzip, and the build fails if a startup chunk ever contains the SDK. Browser reports go through POST /api/errors/tunnel on the site's own origin, limited to 30 a minute per person in the database. Production deploys upload hidden source maps to the tracker and delete them before deploy, and skip that without a token. (0269751, measurement)
  • The tracker. deploy/error-tracker runs Rustrak (server and dashboard, telemetry off, SQLite or PostgreSQL) for a VPS, published through a Cloudflare Tunnel with the dashboard behind Cloudflare Access. A local run received a Worker error, browser errors and a Hermes frame, scrubbed and symbolicated. (12f2043)
Edit on GitHubDocumentation is in English.
Cookie settings
We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience.

Read our Cookie Policy and Privacy Policy.