feat: integrate error hub (errors.bitreport.pt) for runtime error reporting

- Add forwarder/error_reporter.py: Python client for v1/ingest/events
  with cooldown-based dedup, best-effort delivery, and env-driven config
- Add FastAPI global exception handler to report unhandled 500s
- Report sync failures and forward failures from sync_service.py
- Report scheduler job failures from worker/scheduler.py with cooldown
- Report startup failures (ensure_admin_user) from app.py
- Report worker crashes from cli.py entry point
- Add error hub env vars to config.py (pydantic-settings)
- Update .env.example with ERROR_REPORTING_TOKEN and related vars
- Exclude IMAP/SMTP connection test errors per BIT-26136 scope note
- Uses project_slug=bizdocs-forwarder, gitea_repo=BitReport.pt/forwarder

Co-Authored-By: Paperclip <[email protected]>
This commit is contained in:
XikaandPaperclip committed 2026-07-01 00:14:29 +00:00
1 parent f6b276511a
commit 0c63ae7fbd
7 files changed
+282 -4

No files matched your search

+9
View File
@@ -20,3 +20,12 @@ SYNC_INTERVAL_MINUTES=15
DEPLOY_WEBHOOK_SECRET=change_me_random_64_chars
# On CT 243 production, set absolute path to clone:
# FORWARDER_REPO_DIR=/opt/forwarder
# Error hub (errors.bitreport.pt)
ERROR_REPORTING_TOKEN=
ERROR_REPORTING_ENDPOINT=https://errors.bitreport.pt
ERROR_MONITORING_PROJECT_NAME=BizDocs Forwarder
ERROR_MONITORING_PROJECT_SLUG=bizdocs-forwarder
ERROR_MONITORING_GITEA_REPO=BitReport.pt/forwarder
ERROR_MONITORING_PAPERCLIP_PROJECT_ID=
ERROR_MONITORING_ENV=production