Sthora
Monitoring

Alerts

The seven rules, what opens and resolves each one, and how deduplication keeps the list worth reading.

The rules

KindSeverityOpens whenThreshold
DISK_PRESSUREWARNING, CRITICAL at ≥ 95%Disk usage crosses the thresholdALERT_DISK_USED_FRACTION (0.85)
MEMORY_PRESSUREWARNINGMemory stays above the threshold for the sustained windowALERT_MEMORY_USED_FRACTION (0.9), ALERT_MEMORY_SUSTAINED_MINUTES (5)
CONTAINER_RESTART_LOOPCRITICALA container restarts more than n times in the windowALERT_RESTART_COUNT (3), ALERT_RESTART_WINDOW_MINUTES (5)
HEALTH_CHECK_FAILINGCRITICALAn application reports unhealthy
CERTIFICATE_EXPIRINGWARNING, CRITICAL at ≤ 3 daysA certificate is near expiryALERT_CERTIFICATE_EXPIRY_DAYS (14)
DEPLOYMENT_FAILEDWARNINGA deployment fails
BACKUP_FAILEDCRITICALA managed-service backup fails

The thresholds are configurable because a box running one application and a box running twenty disagree about what "too full" means.

When rules are evaluated

  • Sampled rules — disk, memory, restart loops, health checks — against each metrics tick, every 15 seconds.
  • Standing rules — certificate expiry — on the maintenance cron.
  • Event rules — failed deployments and failed backups — when the event happens.

Deduplication

Every alert carries a fingerprint, and an open alert with the same fingerprint is updated rather than duplicated. lastSeenAt moves; a second row does not appear.

That is enforced by a partial unique index on open alerts, written by hand in the migration because Prisma cannot express one.

Every rule both opens and resolves. An alert list that only grows is a list nobody reads, and the whole value of the feature is that an open alert means something is wrong right now.

Status

OPEN or RESOLVED. POST /alerts/:id/resolve closes one by hand.

GET /alerts/summary returns three counts — open, critical, warning — for the shell's badge, so the badge needs no page of rows to render.

Delivery

Alerts open regardless of delivery. If nobody is receiving them, check the portal first to confirm the condition was noticed at all; if it was, the delivery side is at fault. See notification channels.

Delivery runs through the notify queue, one job per channel, so a retry re-attempts only the receiver that failed.

SettingDefault
NOTIFY_MAX_ATTEMPTS4
NOTIFY_BACKOFF_MS10000
NOTIFY_CONCURRENCY4
NOTIFY_WEBHOOK_TIMEOUT_MS10000

On this page