Repository navigation
Open
Labels
enhancementNew feature or request
Description
Errors and panics go only to the log output now, so we do not see a fault until somebody reads the logs. Send them to Sentry, with the release that caused them.
Backend:
- Add the
sentrycrate (0.49 now) with thetracingandpanicintegrations. Give the reason for the new dependency in the pull request body. Checkcargo tree -dfor a secondreqwestversion. - Add an optional DSN to
Configinsrc/app_config.rs, with#[redact]. When the DSN is not set, Sentry stays off, so local builds send nothing. - Change the startup order. Sentry must initialize before the Tokio runtime starts, but
#[tokio::main]atsrc/main.rs:34starts the runtime first. Load the config in a syncmain, initialize Sentry, then build the runtime. - Add the
sentry-tracinglayer to the subscriber atsrc/main.rs:36. By default, error logs become events and info and warn logs become breadcrumbs. - Set the release from the crate version, so that each event links to a release-plz version.
- Add a Salvo hoop that gives each request its own hub, and tags the event with the method and route. Sentry has
sentry-towerandsentry-actix, but no Salvo integration.
UI:
- Add
@sentry/sveltefor browser errors, and use the same release value. The UI builds withadapter-static(ui/svelte.config.js:1), so no SvelteKit server runs in production and@sentry/sveltekitadds no value. - Upload source maps in the release workflow, or the stack traces show only minified code.
Data that must not go to Sentry:
- Keep
send_default_piioff in the backend and the UI. - Remove the auth tokens and cookies from the request data. Steam user IDs also stay out, unless we decide that we need them.
- Add a test or a manual check that shows the content of one real event.
Noise:
- Fix Log property insert failures from bad model data at debug level #145 first, or do it at the same time. Those error logs come from bad model data, and each one becomes a Sentry event.
- Do not turn on performance tracing at first. Set the sample rate to 0, and start it in a separate change if we need it.
Limit: this does not find #144. A process that hangs sends no event, so that issue still needs its health endpoint.
To decide: use sentry.io or self-hosted. Self-hosted Sentry needs a lot of resources, so it may not suit a service of this size. A Sentry-compatible server such as GlitchTip is an alternative, and it needs no change to the SDK setup.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity