DEV Community

Cover image for Master Your Laravel Queues: Introducing Laravel Job Monitor
J-Sandaruwan
J-Sandaruwan

Posted on

Master Your Laravel Queues: Introducing Laravel Job Monitor

Monitoring background jobs in Laravel has always been a bit of a challenge. While Laravel Horizon is fantastic for Redis, many developers working with database, SQS, or other drivers often find themselves flying blind. Even with Horizon, getting a detailed execution history and real-time progress for specific jobs isn't always straightforward.

That's why I'm excited to share my first Laravel package: Laravel Job Monitor.

I built this package to solve a specific problem: providing a lightweight, driver-agnostic way to track, monitor, and manage queue jobs with almost zero configuration.


What is Laravel Job Monitor?

laravel-job-monitor is a lightweight package that automatically hooks into Laravel's queue system to track every job that enters your system. Whether it's processing, completed, or failed, you get a full audit trail including runtimes, attempt counts, and detailed error logs.

Key Features

1. Automatic "Zero-Touch" Tracking

The beauty of this package is that it requires no code changes to your existing jobs. Once installed, it listens to standard queue events and starts logging history immediately.

2. Real-Time Progress Tracking

Have a long-running job like a video export or a massive data import? You can now track progress from 0 to 100% using a simple trait:

use JSandaruwan\LaravelJobMonitor\Traits\TracksJobProgress;

class MassiveImportJob implements ShouldQueue
{
    use TracksJobProgress;

    public function handle()
    {
        $this->updateProgress(10); // 10% complete

        // ... heavy lifting ...

        $this->updateProgress(90); // 90% complete
    }
}
Enter fullscreen mode Exit fullscreen mode

3. Built-in REST API

Integration is at the heart of this package. It comes with pre-built, configurable API endpoints so you can easily build your own dashboard or integrate job status into your existing admin panel.

  • GET /api/job-monitor/jobs – List with advanced filtering (status, queue, date, etc.)
  • GET /api/job-monitor/jobs/stats – Overview of your queue health.
  • POST /api/job-monitor/jobs/{id}/retry – One-tap retry for failed jobs.

4. Zero Dependencies

Keep your vendor folder light! The package doesn't require any external monitoring services or heavy third-party assets. It uses your existing database to store history.


Why I Built It

In many projects, I found myself manually creating "activity_logs" or "job_statuses" tables just to see why a particular background job was taking so long or why it failed for a specific user. I wanted a standardized way to handle this across all my Laravel projects—and hopefully, it helps you too!

Getting Started

You can install it today via Composer:

composer require j-sandaruwan/laravel-job-monitor
Enter fullscreen mode Exit fullscreen mode

Then simply publish the config and run migrations:

php artisan vendor:publish --provider="JSandaruwan\LaravelJobMonitor\JobMonitorServiceProvider"
php artisan migrate
Enter fullscreen mode Exit fullscreen mode

And that's it! Your jobs are now being monitored.


What's Next?

This is just the beginning. I'm planning to add more features like:

  • A built-in, ready-to-use Blade dashboard.
  • Support for job batching progress.
  • Custom notification triggers for failed jobs (Slack/Discord).

Check out the source code on GitHub and feel free to open an issue or PR. If you find it useful, a ⭐️ on GitHub would mean the world to me for my first package!

Happy coding! 🚀

Thank you,
Janith Sandaruwan.
linkedin

Top comments (0)