Skip to content

Integrate Sentry for error reporting in the backend and the UI #149

Open

Description

@disconsented

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 sentry crate (0.49 now) with the tracing and panic integrations. Give the reason for the new dependency in the pull request body. Check cargo tree -d for a second reqwest version.
  • Add an optional DSN to Config in src/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] at src/main.rs:34 starts the runtime first. Load the config in a sync main, initialize Sentry, then build the runtime.
  • Add the sentry-tracing layer to the subscriber at src/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-tower and sentry-actix, but no Salvo integration.

UI:

  • Add @sentry/svelte for browser errors, and use the same release value. The UI builds with adapter-static (ui/svelte.config.js:1), so no SvelteKit server runs in production and @sentry/sveltekit adds 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_pii off 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:

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.

Activity

  1. added
    enhancement
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions