spatie/laravel-failed-job-monitor
Laravel package that notifies you when queued jobs fail. Uses Laravel’s notification system and supports email and Slack out of the box, with configurable notifiables and custom notification classes for your own alerting needs.
Illuminate\Queue\Jobs\Job) and leverages Laravel’s Notification system, making it a low-friction addition for observability.composer require + config publish, with no database migrations or schema changes.guzzlehttp/guzzle)..env-based configuration for channels/recipients (e.g., FAILED_JOB_SLACK_WEBHOOK_URL), improving security and flexibility.notificationFilter are not serializable (breaks config:cache). Mitigation: Use a static class method (documented in README)..env-based config suffice, or are dynamic recipients/channels needed? (Use environment variables or a custom notifiable.)php artisan queue:work or Horizon).composer require spatie/laravel-failed-job-monitor guzzlehttp/guzzle
php artisan vendor:publish --tag=failed-job-monitor-config
FAILED_JOB_SLACK_WEBHOOK_URL (if using Slack) and mail.to in .env.config/failed-job-monitor.php for channels/recipients.notificationFilter if filtering is needed (e.g., ignore JobWasTooBigException).queue:work, queue:listen, Horizon). Note: Supervisor/Foreman configs unchanged.spatie/laravel-activitylog).notificationFilter as needed..env for sensitive data (e.g., Slack webhooks). Action: Document config changes.^4.3) to avoid surprises.ConnectionException).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Slack webhook URL misconfigured | No alerts delivered | Validate .env and test with a dummy job. |
| Mail server down | Email alerts fail | Use a fallback channel (e.g., SMS). |
| Database queue locks | Failed jobs pile up | Monitor queue length; adjust failed_jobs table size. |
| Custom notification class breaks | No alerts, silent failures | Test custom classes in staging. |
config:cache with closure filter |
Application crashes | Use a static class method for filtering. |
throw new Exception('test') in a job).QueueOverflowException, scale workers").notificationFilter for future customization.StorageException appears, check S3 permissions").How can I help you explore Laravel packages today?