server: report HTTP handler panics to Sentry (closes #107)
check / check (push) Successful in 1m35s
check / check (push) Successful in 1m35s
DNSWATCHER_SENTRY_DSN was read but never used. This ports the Sentry integration from gohttpserver with sentry-go v0.49.0. The server's start hook calls sentry.Init when the DSN is set; a DSN Sentry cannot parse fails the hook, so startup stops with the parse error. sentryhttp, with Repanic, reports handler panics and passes them on to chi's Recoverer. Shutdown sends queued reports once the HTTP server has stopped. The client uses the older transport (DisableTelemetryBuffer): with the default one, Flush can return before sending a report made just before it. Client reports are off, so only panics are sent. The DSN is checked at server start, not in config, so the config test is unchanged. sentry-go raises several golang.org/x modules and moves go-spew and go-difflib to untagged commits. Model: opus-5-5
This commit was merged in pull request #184.
This commit is contained in:
@@ -359,6 +359,13 @@ either is set to anything else, including a bare number or a zero or negative
|
||||
duration, dnswatcher refuses to start with an error naming the variable and
|
||||
the value.
|
||||
|
||||
**`DNSWATCHER_SENTRY_DSN` reports crashes in HTTP requests to Sentry.** When it
|
||||
is set, a panic in an HTTP request handler is sent to Sentry, and the request
|
||||
still gets a `500 Internal Server Error` answer. Nothing else is sent to Sentry:
|
||||
DNS, port and TLS problems are reported as notifications. A value Sentry cannot
|
||||
parse stops dnswatcher at startup. At shutdown, reports not yet sent are sent,
|
||||
waiting at most 2 seconds.
|
||||
|
||||
### Example `.env`
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user