Sentry error reporting when SENTRY_DSN is set #95

Closed
opened 2026-10-03 17:25:25 +02:00 by clawbot · 1 comment
Collaborator

Split out of #27. The backend reads SENTRY_DSN and does nothing with it. GO_HTTP_SERVER_CONVENTIONS.md in sneak/prompts (section 14, "Sentry Error Reporting") makes github.com/getsentry/sentry-go mandatory and says how it is wired.

Definition of done

  • When SENTRY_DSN is set, the backend initialises Sentry with release <appname>-<version>, adds the sentryhttp middleware with Repanic: true in the place the conventions give in the middleware order, and flushes Sentry (2 seconds) on shutdown. A DSN Sentry refuses stops the start with an error naming SENTRY_DSN. When it is empty, nothing is initialised and nothing leaves the container.
  • A test: with SENTRY_DSN empty no Sentry client exists; with a DSN pointing at a local test server, a handler panic reaches that server and the request still gets the existing 500 from the panic recovery.
  • README.md "Running under upaas" and backend/README.md list the setting and say that set, it sends errors to that Sentry project.
  • Dependency checked against the Go package defaults and pinned by go.sum.
  • Root make check and script/cibuild pass; TODO.md updated in the same commit; commit title ends (closes #N).

Model: opus-5-5

Split out of https://git.eeqj.de/sneak/netwatch/issues/27. The backend reads `SENTRY_DSN` and does nothing with it. `GO_HTTP_SERVER_CONVENTIONS.md` in `sneak/prompts` (section 14, "Sentry Error Reporting") makes `github.com/getsentry/sentry-go` mandatory and says how it is wired. ## Definition of done - When `SENTRY_DSN` is set, the backend initialises Sentry with release `<appname>-<version>`, adds the `sentryhttp` middleware with `Repanic: true` in the place the conventions give in the middleware order, and flushes Sentry (2 seconds) on shutdown. A DSN Sentry refuses stops the start with an error naming `SENTRY_DSN`. When it is empty, nothing is initialised and nothing leaves the container. - A test: with `SENTRY_DSN` empty no Sentry client exists; with a DSN pointing at a local test server, a handler panic reaches that server and the request still gets the existing 500 from the panic recovery. - `README.md` "Running under upaas" and `backend/README.md` list the setting and say that set, it sends errors to that Sentry project. - Dependency checked against the Go package defaults and pinned by `go.sum`. - Root `make check` and `script/cibuild` pass; `TODO.md` updated in the same commit; commit title ends ` (closes #N)`. Model: opus-5-5
clawbot self-assigned this 2026-10-03 17:25:25 +02:00
Author
Collaborator

Built in #107: with SENTRY_DSN set, a panic in a handler is reported to that Sentry project and the request still gets 500, and on shutdown Sentry gets up to 2 seconds to finish sending; a DSN Sentry refuses stops the start, naming SENTRY_DSN. With it empty, Sentry is never set up. Both READMEs list the setting.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/netwatch/pulls/107: with `SENTRY_DSN` set, a panic in a handler is reported to that Sentry project and the request still gets 500, and on shutdown Sentry gets up to 2 seconds to finish sending; a DSN Sentry refuses stops the start, naming `SENTRY_DSN`. With it empty, Sentry is never set up. Both READMEs list the setting. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#95