feat: report Thermopylae errors to Mado #10

Merged
exler merged 1 commit from feat/mado-error-reporting into main 2026-10-22 23:18:11 +02:00
Collaborator

Summary

  • Send unexpected HTTP errors, recovered panics, janitor error logs and terminal server errors to Mado using the open-source Sentry Go SDK.
  • Enable solely with MADO_DSN; empty leaves tracking disabled. Preserve Fiber responses and report each panic once.
  • Use a bounded asynchronous queue, a 2s delivery timeout and shutdown flushing.

Privacy

No request object, cookies, headers, query strings, bodies, IP addresses or user identity are attached. Request context is only method + matched route template. Error text is sent verbatim: future handlers must not put secrets into error messages. Tracing and breadcrumbs are disabled. Each server owns its reporter, without global SDK state.

Verification

  • go vet ./... — pass.
  • go test ./... — pass.
  • Seven focused TestMado* tests — pass: envelope/auth compatibility, 500/panic deduplication and stack, excluded request secrets, expected-response suppression, disabled/invalid config, nonblocking delivery, janitor/log reporting.
  • Actual local Mado at revision d23a225 accepted an event emitted by Thermopylae and persisted it with stack frames, empty request/user payloads and one occurrence (isolated fixture database, not production).
  • git diff --check — clean.
  • Local go test -race ./... cannot start on this ARM host: ThreadSanitizer unsupported VMA range (47 vs 48), reproduced on unchanged base 99b9c57. The existing PR CI ran go vet ./... and go test -race ./... successfully on this head (run 22, test job success; image publishing correctly skipped for the PR).

Limitations / rollback

Returned Go errors show the capture-site stack unless they already carry a stack; panic stacks retain the panic site. Errors before reporter initialization (configuration/database opening) and directly written 5xx responses are not captured. Unset MADO_DSN to disable. No production deployment or project provisioning is included in this PR.

## Summary - Send unexpected HTTP errors, recovered panics, janitor error logs and terminal server errors to Mado using the open-source Sentry Go SDK. - Enable solely with `MADO_DSN`; empty leaves tracking disabled. Preserve Fiber responses and report each panic once. - Use a bounded asynchronous queue, a 2s delivery timeout and shutdown flushing. ## Privacy No request object, cookies, headers, query strings, bodies, IP addresses or user identity are attached. Request context is only method + matched route template. Error text is sent verbatim: future handlers must not put secrets into error messages. Tracing and breadcrumbs are disabled. Each server owns its reporter, without global SDK state. ## Verification - `go vet ./...` — pass. - `go test ./...` — pass. - Seven focused `TestMado*` tests — pass: envelope/auth compatibility, 500/panic deduplication and stack, excluded request secrets, expected-response suppression, disabled/invalid config, nonblocking delivery, janitor/log reporting. - Actual local Mado at revision `d23a225` accepted an event emitted by Thermopylae and persisted it with stack frames, empty request/user payloads and one occurrence (isolated fixture database, not production). - `git diff --check` — clean. - Local `go test -race ./...` cannot start on this ARM host: ThreadSanitizer unsupported VMA range (47 vs 48), reproduced on unchanged base `99b9c57`. The existing PR CI ran `go vet ./...` and `go test -race ./...` successfully on this head (run 22, test job success; image publishing correctly skipped for the PR). ## Limitations / rollback Returned Go errors show the capture-site stack unless they already carry a stack; panic stacks retain the panic site. Errors before reporter initialization (configuration/database opening) and directly written 5xx responses are not captured. Unset `MADO_DSN` to disable. No production deployment or project provisioning is included in this PR.
feat: report unexpected errors to Mado
All checks were successful
Push Docker Image / test (pull_request) Successful in 1m11s
Push Docker Image / push (pull_request) Has been skipped
Push Docker Image / test (push) Successful in 1m14s
Push Docker Image / push (push) Successful in 1m0s
e855460a95
exler merged commit e855460a95 into main 2026-10-22 23:18:11 +02:00
exler deleted branch feat/mado-error-reporting 2026-10-22 23:18:11 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
exler/thermopylae!10
No description provided.