Skip to content

feat: super console monitoring (alarms, events, logs) - #60

Merged
haxurus merged 1 commit into
mainfrom
feat/monitoring
Oct 20, 2026
Merged

haxurus merged 1 commit into
mainfrom
feat/monitoring

Conversation

@haxurus

@haxurus haxurus commented Oct 20, 2026

Copy link
Copy Markdown
Owner

What and why

Brings Sentinel's super console on par with Muse for monitoring.

  • Bot down / restored alarms: the API checks the bot's /healthz every 30 s. After 4 failed checks (~2 min, longer than a deploy restart) it records an event and posts to a Discord webhook configured in Super console → Monitoring (encrypted at rest, never returned by the API). A second message reports the recovery and the downtime. A webhook is used because the bot cannot report its own outage.
  • Instance events: new InstanceEvent table. Every bot status notice (startup, client errors and warnings, servers added/removed/rejected, quotas, cleanup) is recorded even without a status channel; watchdog alarms too. Encrypted details, 90-day retention. Grants: bot INSERT only (createMany, no RETURNING), API full; CI privilege checks extended.
  • Logs tab: latest 2,000 lines of the bot and of the API, kept in memory via a pino multistream, redacted; filter by service and level, auto refresh. Health checks no longer log at info.
  • Docker logs capped (json-file, 5 × 10 MB) in both Compose files — needs the prod Compose file reinstalled on the VPS.
  • /health/bot (public, no details) for an external uptime monitor.

How it was tested

CI: typecheck, tests (new log buffer test), migrations + drift check, DB privilege checks, Compose validation.

🤖 Generated with Claude Code

…, logs

- API watchdog checks the bot every 30 s; after ~2 minutes without answer it
  posts "bot unreachable" to a Discord webhook set in the super console (stored
  encrypted), and "bot restored" with the downtime when it is back.
- InstanceEvent table: every status notice of the bot (startup, errors,
  servers added/removed/rejected, quotas) plus watchdog alarms, shown in the
  super console and kept 90 days. The bot can only insert.
- Logs tab: latest bot and API log lines from in-memory, redacted buffers.
  Health-check requests are no longer logged at info level.
- Docker json-file logs capped at 5 x 10 MB per service.
- Public /health/bot for external uptime monitors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@haxurus
haxurus merged commit 5ca1711 into main Oct 20, 2026
5 checks passed
@haxurus
haxurus deleted the feat/monitoring branch October 20, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant