spatie/laravel-failed-job-monitor
Send instant notifications when Laravel queued jobs fail. Uses Laravel’s notification system with built-in Mail and Slack support, configurable via env/config, and easy install/publish. Great for monitoring production queues and alerting the right people.
Pros:
Cons:
Notification and Notifiable).notificationFilter)..env variables (e.g., invalid Slack webhook) could prevent notifications from sending.Queue Infrastructure:
Notification Workflow:
Customization Needs:
Operational Constraints:
Testing and Validation:
Scaling Considerations:
php artisan queue:work, Supervisor, Forge, or cloud-based workers like AWS Fargate).guzzlehttp/guzzle for webhook calls.Prerequisites:
Installation:
composer require spatie/laravel-failed-job-monitor
composer require guzzlehttp/guzzle # Only if using Slack
php artisan vendor:publish --tag=failed-job-monitor-config
Configuration:
.env with notification channels and recipients:
FAILED_JOB_MONITOR_ENABLED=true
FAILED_JOB_CHANNELS=mail,slack
FAILED_JOB_EMAILS=devops@example.com,oncall@example.com
FAILED_JOB_SLACK_WEBHOOK_URL=https://hooks.slack.com/...
config/failed-job-monitor.php as needed (e.g., override notification classes, add filters).Testing:
handle() method).Deployment:
FAILED_JOB_MONITOR_ENABLED=true).Phase 1: Pilot (Development/Staging):
Phase 2: Rollout (Production):
Phase 3: Optimization:
.env or config file updates..env variables, queue worker health, and notification channel configurations.failed:table for inspecting failed jobs.storage/logs/laravel.log) for errors.How can I help you explore Laravel packages today?