Skip to content

Alerts

BullMQ has no alerts of its own. Bullship keeps alert rules in its data directory and checks them every 30 seconds, on each connection separately, so one Redis that hangs doesn’t delay the rest.

A destination is where alerts go. Admins add them in Settings › Alert destinations, and every connection’s rules can send to them. Each one has Send test, which sends a test notice and shows what the service answered.

Kind Target Notes
Slack An incoming webhook URL, https://hooks.slack.com/services/… Name it after the channel, such as #ops-alerts. Messages have an Open in Bullship button
PagerDuty The integration key of an Events API v2 service Pick the severity: critical, error, warning or info. One incident per rule and queue; it resolves when the alert does
Email An address Needs BULLSHIP_SMTP_URL; without it email destinations can’t be added
Webhook Any https:// or http:// URL A JSON POST, optionally signed. See Webhooks

Bullship shows a destination’s URL or key only with its secret part hidden, such as hooks.slack.com/services/••••. With BULLSHIP_SECRET_KEY set, targets are encrypted on disk.

Operators create rules on a connection’s Alerts page. A rule watches one metric, on one queue, on every queue, or on the queues whose names match a pattern such as ingest.* (* is any run of characters):

Watches Fires when Default
Failed jobs Jobs that failed in the last 1, 5, 15 or 60 minutes above 50 in 5 min
Waiting jobs The backlog in wait and prioritized, held for a while above 1,000 for 10 min
Oldest waiting job How long the next job has waited, in seconds above 300, right away
Workers Worker connections on the queue equals 0 for 2 min
Stalled jobs Jobs whose lock expired mid-run, in the last 1 to 60 minutes above 0 in 15 min
Scheduler run failed A job scheduler’s last run failed right away
Redis memory used_memory as a percentage of maxmemory above 80% for 5 min
Redis unreachable Bullship can’t reach the Redis (a PING every 30 seconds) for 2 min

Thresholds compare with is above, is below or equals. A “held” rule fires only once its condition has held for the whole window; pick right away to fire on the first reading. The editor previews the last 24 hours, so you see how often a threshold would have fired before you save it.

A rule on several queues fires and resolves for each queue on its own. A connection has at most 100 rules.

  • Bullship notifies the rule’s destinations, then again every 30 min, every hour or once, as the rule says, and tells them when it resolves.
  • A destination that didn’t accept a notice gets it again after 30 seconds, then 1, 2 and 4 minutes and so on, at most every 10 minutes. History then says “Delivered after retrying”.
  • Mute for 1 hour silences a rule while you work on it; Unmute ends that early.
  • A rule whose queues went away resolves, and closes its PagerDuty incident, instead of firing on.

Each rule’s page shows its history for 30 days: when it fired, resolved, was muted, and which destinations got each notice.

Notices link to the connection’s Alerts page. The link uses BULLSHIP_URL, or otherwise the address of the last signed-in visit, so set BULLSHIP_URL for links that always work.