uptd-pelita / laravel-queue-monitoring
Horizon-style queue dashboard for Laravel: monitor, inspect, retry, pause, resume and clear jobs on Redis, database and other queue drivers.
Package info
github.com/uptd-pelita/laravel-queue-monitoring
pkg:composer/uptd-pelita/laravel-queue-monitoring
Requires
- php: ^8.3
- illuminate/bus: ^13.0
- illuminate/console: ^13.0
- illuminate/database: ^13.0
- illuminate/http: ^13.0
- illuminate/queue: ^13.0
- illuminate/support: ^13.0
- illuminate/view: ^13.0
Requires (Dev)
None
Suggests
- ext-pcntl: Allows stopping a single worker from the dashboard.
- ext-redis: Required to monitor queues on the redis driver with phpredis.
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-12-04 00:47:21 UTC
README
A Horizon-style dashboard for Laravel queues. See how many jobs are pending, running and failed, open any job to inspect its payload, retry failed jobs, and pause, resume or clear queues from the browser.
Unlike Horizon, it works with the database driver as well as Redis, and it uses your normal queue:work workers. There is no extra daemon to run.
- Requirements
- Installation
- Giving access
- Choosing which queues to monitor
- Running workers
- Using the dashboard
- Appearance: themes and layouts
- Alerts
- JSON API
- Artisan commands
- Configuration reference
- Performance
- Security
- Troubleshooting
- Upgrading and uninstalling
Requirements
| PHP | 8.3 or newer |
| Laravel | 13.x |
| Queue drivers | redis and database: full support. sqs, beanstalkd: counters, pause/resume and clear only (these drivers cannot list individual jobs). |
| Optional | ext-redis or predis/predis for Redis, ext-posix to stop a single worker from the dashboard. |
Installation
composer require uptd-pelita/laravel-queue-monitoring php artisan migrate php artisan queue:restart
composer requireinstalls the package. It is discovered automatically, so there is no provider to register.migratecreates four tables:queue_monitor_jobs,queue_monitor_metrics,queue_monitor_workersandqueue_monitor_audits.queue:restartmakes running workers reload, so they start recording history, metrics and heartbeats.
Then open https://your-app.test/queue-monitor.
By default the dashboard only opens in the local environment. Read Giving access before you deploy.
To change the defaults, publish the config file:
php artisan vendor:publish --tag=queue-monitor-config
Giving access
Two gates control access:
| Gate | Allows |
|---|---|
viewQueueMonitor |
Opening any dashboard page, plus the JSON API. |
manageQueueMonitor |
Every action that changes something: retry, delete, pause, resume, clear, flush, restart, stop. |
If you don't define them, both allow access only when APP_ENV=local. Define them in App\Providers\AppServiceProvider::boot():
use App\Models\User; use Illuminate\Support\Facades\Gate; public function boot(): void { Gate::define('viewQueueMonitor', fn (User $user) => $user->is_admin); // Optional. When omitted, anyone who can view can also manage. Gate::define('manageQueueMonitor', fn (User $user) => $user->is_admin); }
The gates above need a logged-in user, so also add the auth middleware in config/queue-monitor.php:
'middleware' => ['web', 'auth'],
Users who can view but not manage still see every page. The action buttons are hidden from them, and the server rejects those requests with 403.
Choosing which queues to monitor
With no configuration, the package monitors your default queue connection (QUEUE_CONNECTION) and finds its queue names automatically.
To monitor more connections, or to list queues explicitly, set connections in config/queue-monitor.php:
'connections' => [ 'redis' => '*', // discover every queue on this connection 'database' => ['default', 'emails'], // only these queues ],
- Redis discovery (
'*') finds queues from theirqueues:*keys. The connection's default queue is always shown. Other queues only appear while they hold at least one job, or while a worker is listening on them. - Database discovery (
'*') reads the distinctqueuevalues in the jobs table. If two connections share one jobs table, list their queues explicitly. Otherwise each connection also shows the other's queues. - Queues that an online worker listens on are always added.
Running workers
The dashboard reads from workers you already run with php artisan queue:work. It does not start workers itself, so keep them running with a process manager such as Supervisor, systemd, or a Docker restart policy.
Example Supervisor config (/etc/supervisor/conf.d/laravel-worker.conf):
[program:laravel-worker] command=php /var/www/html/artisan queue:work redis --queue=high,default --sleep=3 --tries=3 --max-time=3600 numprocs=2 process_name=%(program_name)s_%(process_num)02d autostart=true autorestart=true stopasgroup=true killasgroup=true user=www-data stopwaitsecs=3600 redirect_stderr=true stdout_logfile=/var/www/html/storage/logs/worker.log
sudo supervisorctl reread && sudo supervisorctl update
Also make sure the scheduler runs every minute (php artisan schedule:run). The package uses it to prune old data and to send alerts.
Using the dashboard
All pages live under /queue-monitor (change this with QUEUE_MONITOR_PATH). Pages that show live data refresh every 5 seconds. Click Live in the top bar to pause refreshing.
Dashboard
- Totals: pending, delayed, running and failed jobs, jobs processed in the last hour, online workers, and the longest wait.
- Throughput chart: the last 60 minutes.
- Queues table: one row per queue, with its counters and status (
Active,PausedorUnreachable). - Pause all / Resume all: workers stop or start taking new jobs on every queue. Running jobs finish normally.
- Restart workers: sends
queue:restart. Each worker exits after its current job, and your process manager starts it again.
A single queue
Click a queue name to see:
- Tabs:
Pending,DelayedandRunningjobs, with pagination. - Details: the full payload of a job and its decoded job data (the properties of your job class).
- Delete: removes one job from the queue. It will never run.
- Pause: stops the queue until you resume it, or for 5 minutes up to 24 hours.
- Clear: deletes every pending, delayed and running job on that queue. To confirm, you must type the queue name. Failed jobs are not affected.
Failed jobs
- Search: by job class, exception text or ID, and filter by queue.
- Details: the exception message, the full stack trace, the payload, and every attempt recorded for that job.
- Retry: one job, the jobs you selected, or every job that matches the current filter.
- To retry onto a different queue, fill in Retry onto queue. This is useful for sending jobs to a dedicated
retriesqueue. - Retrying works exactly like
php artisan queue:retry: the attempts counter is reset and the job is pushed back onto its connection.
- To retry onto a different queue, fill in Retry onto queue. This is useful for sending jobs to a dedicated
- Delete / Flush: removes failed job records. Flush can remove all of them or only those older than a period, and you must type
FLUSHto confirm. - Export CSV: downloads the current list.
Recent jobs
Every finished attempt, with its status (completed, failed, released), wait time, runtime and worker. History is kept for 72 hours by default.
Metrics
- Range: the last hour, 6 hours, 24 hours or 7 days.
- Totals and chart: jobs processed, failed and released, average and maximum runtime, and average wait.
- Breakdowns: per queue and per job class.
Batches
Jobs dispatched with Bus::batch(). You can see a batch's progress and its failed jobs, retry the failed jobs, cancel the batch, or delete its record. This page needs the job_batches table (php artisan make:queue-batches-table).
Workers
Every queue:work process: host, PID, queues, current job, jobs processed, memory and last heartbeat.
- Stop: stops one worker after its current job.
- Offline: a worker that has not reported for 60 seconds is marked offline. A worker running a long job stays online until that job's timeout.
Audit log
Every action taken from the dashboard: who did it, what they did, which queue, when, and from which IP. Each action is also written to your application log.
Appearance: themes and layouts
Themes
Set QUEUE_MONITOR_THEME to one of:
| Theme | Description |
|---|---|
custom (default) |
The package's own stylesheet, with no framework. |
bootstrap |
Bootstrap 5.3 classes. Loads Bootstrap from a CDN. |
tailwind |
Tailwind 4 utilities. Loads the Tailwind browser build from a CDN. |
Dark mode: in standalone mode, the Theme button switches dark mode on and off, and your choice is saved in the browser.
Using Tailwind in production
The Tailwind CDN build is fine for internal tools. For production, compile the package views with your own Tailwind build. Add this line to your CSS (for example resources/css/app.css):
@source "../../vendor/uptd-pelita/laravel-queue-monitoring/resources/views";
Then stop loading the CDN build:
'assets' => ['tailwind' => null, /* ... */],
Changing the colours of the custom theme
The custom theme is styled through CSS variables, so you can override any of them:
.qm-root { --qm-primary: #0f766e; --qm-radius: 4px; }
It also reads common design tokens when your app defines them, such as --bg-primary, --text-default, --border-default and --font-sans. In that case it follows your design system automatically.
Changing individual CSS classes
You can replace the classes of any element, per theme:
'classes' => [ 'bootstrap' => ['btn-primary' => 'btn-dark'], 'custom' => ['card' => 'qm-card my-card'], ],
To see every element name, look at src/Support/Theme.php.
Showing the dashboard inside your own layout
By default the dashboard is a standalone page. To show it inside your application's layout, for example next to your sidebar and header:
'layout' => [ 'view' => 'layouts.app', // your Blade layout 'section' => 'content', // the section your layout @yield()s ],
- Title: the page title is passed to your layout as
$title. - CSS framework: if your layout already loads Bootstrap or Tailwind, set
assets.bootstraporassets.tailwindtonull, so it isn't loaded twice. - Extra stylesheets: add them through
assets.stylesheets.
Changing the views
php artisan vendor:publish --tag=queue-monitor-views
This copies the views to resources/views/vendor/queue-monitor, where you can edit them.
Alerts
queue-monitor:check checks the following rules. The scheduler runs it every minute when alerts are enabled.
| Rule | Triggers when |
|---|---|
pending_threshold |
A queue has at least this many pending jobs (default 1000). |
wait_seconds_threshold |
The oldest pending job has waited this long (default 300 seconds). |
failed_threshold |
At least this many jobs failed within failed_window_minutes (default 10 in 5 minutes). |
no_workers |
A queue has pending jobs but no online worker. |
unreachable |
A queue cannot be read, for example because Redis is down. |
Enable alerts in .env:
QUEUE_MONITOR_ALERTS=true QUEUE_MONITOR_ALERT_MAIL=ops@example.com,dev@example.com QUEUE_MONITOR_ALERT_WEBHOOK=https://hooks.slack.com/services/XXX/YYY/ZZZ
- Thresholds: change them under
alertsin the config. Set one tonullto turn that rule off. - Cooldown: each rule notifies at most once per
cooldown_minutes(default 15) for each queue. - Webhook: the package POSTs a Slack-compatible body. It also works for Discord (add
/slackto the webhook URL), Mattermost, or your own endpoint:
{ "text": "*My App queue alert*\n• Queue redis:default has 1500 pending jobs (threshold 1000).", "alerts": [{ "rule": "pending_threshold", "message": "...", "context": { "connection": "redis", "queue": "default", "pending": 1500 } }] }
To handle alerts in your own code, for example to send Telegram or WhatsApp messages, listen to the event:
use UptdPelita\QueueMonitor\Events\QueueAlertTriggered; use Illuminate\Support\Facades\Event; Event::listen(function (QueueAlertTriggered $alert) { // $alert->rule, $alert->message, $alert->context });
To see which alerts would fire without sending anything, run php artisan queue-monitor:check --dry-run.
JSON API
GET /queue-monitor/api/stats returns the same data as the dashboard. It uses the same middleware and gates, which makes it useful for uptime monitors or other dashboards.
{
"version": "1.0.0",
"generated_at": "2026-12-01T10:00:00+07:00",
"all_paused": false,
"totals": { "pending": 12, "delayed": 3, "reserved": 2, "failed": 1, "failed_last_hour": 0, "workers": 2, "busy_workers": 1, "max_wait_seconds": 4 },
"last_hour": { "processed": 840, "failed": 1, "released": 0, "avg_runtime_ms": 120, "max_runtime_ms": 2300, "avg_wait_ms": 450, "per_minute": 14 },
"queues": [{ "connection": "redis", "queue": "default", "pending": 12, "delayed": 3, "reserved": 2, "failed": 1, "total": 17, "wait_seconds": 4, "paused": false, "driver": "redis", "error": null }],
"workers": [{ "id": "web-1:4312", "connection": "redis", "queue": "default", "status": "busy", "current_job": "App\\Jobs\\SendInvoice", "jobs_processed": 391, "memory_mb": 48, "last_seen_at": "2026-12-01 10:00:00" }]
}
Artisan commands
# Delete old history, metrics and audit entries, and stale workers. Runs hourly via the scheduler. php artisan queue-monitor:prune php artisan queue-monitor:prune --history=24 --metrics=72 --audits=720 # retention in hours # Evaluate the alert rules. Runs every minute via the scheduler when alerts are enabled. php artisan queue-monitor:check php artisan queue-monitor:check --dry-run
To schedule these commands yourself, set 'schedule' => false and add them to routes/console.php.
Configuration reference
| Key | Default | Description |
|---|---|---|
enabled |
true |
Registers the dashboard routes. Env QUEUE_MONITOR_ENABLED. |
path |
queue-monitor |
URL prefix. Env QUEUE_MONITOR_PATH. |
domain |
null |
Serves the dashboard on a separate domain. Env QUEUE_MONITOR_DOMAIN. |
middleware |
['web'] |
Route middleware. The gates always apply on top of it. |
action_throttle |
60,1 |
Rate limit for actions (requests per minute). |
connections |
[] |
Connections and queues to monitor. See above. |
ignore_connections |
sync, null, ... |
Connections that are never shown or recorded. |
ignore_jobs |
[] |
Job classes that are not recorded in history or metrics. |
theme |
custom |
custom, bootstrap or tailwind. Env QUEUE_MONITOR_THEME. |
classes |
[] |
Per-theme CSS class overrides. |
layout.view / layout.section |
null / content |
Renders the dashboard inside your layout. |
assets |
CDN URLs | Bootstrap / Tailwind URLs (null to skip), plus extra stylesheets. |
dark_mode |
true |
Shows the dark mode toggle. |
polling |
5 |
Seconds between automatic refreshes. 0 turns refreshing off. |
per_page |
25 |
Rows per page. |
mask_keys |
password, token, ... |
Keys whose values are hidden in payloads, exceptions and exports. |
database_connection |
null |
Database connection for the package tables. Env QUEUE_MONITOR_DB_CONNECTION. |
record.history / .metrics / .workers |
true |
Turns each kind of recording on or off. Env QUEUE_MONITOR_RECORD_*. |
heartbeat_seconds |
10 |
How often an idle worker reports. |
worker_offline_after |
60 |
Seconds without a heartbeat before a worker is shown as offline. |
retention.* (hours) |
history 72, metrics 168, audits 2160, workers 24 | Used by queue-monitor:prune. |
schedule |
true |
Registers the prune and check commands with the scheduler. |
alerts.* |
disabled | See Alerts. |
Performance
- Dashboard: it only runs count queries. On Redis these are O(1) (
LLEN,ZCARD); on the database they are indexedCOUNTs. - Workers: each processed job adds about 2 small writes to your database (one history row and one metrics upsert). Worker heartbeats are throttled to one write every 10 seconds.
- Measured on SQLite with no-op jobs, this adds about 0.5 ms per job. For real jobs it is negligible.
- For thousands of jobs per minute, set
QUEUE_MONITOR_RECORD_HISTORY=false, or pointQUEUE_MONITOR_DB_CONNECTIONat a separate database.
- Footprint: no extra processes, no Node build step, and no dependencies beyond Laravel itself.
Security
- Access: every route goes through your middleware and the
viewQueueMonitorgate. Every state-changing request also needsmanageQueueMonitor, a CSRF token, and passes a rate limit. - Confirmation: destructive actions ask for confirmation. Clear and flush also require typing a confirmation word, which the server checks again.
- Payloads: they are never unserialized for display. The package reads PHP's serialize format as text, so no class is ever loaded or instantiated.
- Encrypted jobs: for jobs that implement
ShouldBeEncrypted, the job data is not displayed. - Masking: values whose key contains a
mask_keysfragment are shown as********. - CSV export: it guards against spreadsheet formula injection.
Troubleshooting
The dashboard returns 403.
You are not in the local environment and haven't defined the viewQueueMonitor gate, or the gate returned false. See Giving access.
Recent jobs, Metrics and Workers stay empty.
Run php artisan migrate, then php artisan queue:restart. Workers that started before the package was installed don't record anything.
Pause has no effect.
Workers read the pause flag from the cache. The web app and the workers must use the same CACHE_STORE, for example redis or database, not array or file on separate servers. A worker finishes its current job before pausing.
Restart workers stopped my workers and they didn't come back.
queue:restart makes workers exit gracefully. Only a process manager (Supervisor, systemd, Docker) starts them again. See Running workers.
A Redis queue disappeared from the dashboard.
With '*' discovery, an empty Redis queue has no keys, so it can't be found. List the queue explicitly in connections, or keep a worker listening on it.
A queue shows Unreachable.
The connection could not be read. Hover over the badge to see the error, which is usually a Redis connection or credentials problem.
Upgrading and uninstalling
Moving from angga/queue-monitor: this package was first published as angga/queue-monitor with the Angga\QueueMonitor namespace. The tables, config keys, routes and gates are unchanged, so no migration is needed. Only the PHP namespace changed.
composer remove angga/queue-monitor composer require uptd-pelita/laravel-queue-monitoring
Then replace Angga\QueueMonitor with UptdPelita\QueueMonitor in your own code (for example event listeners and tests), and run php artisan queue:restart.
Upgrade:
composer update uptd-pelita/laravel-queue-monitoring php artisan migrate php artisan queue:restart
Uninstall. Drop the package tables first, while the package is still installed. Only migrations in this path are rolled back; the others are reported as "Migration not found" and left untouched.
php artisan migrate:reset --path=vendor/uptd-pelita/laravel-queue-monitoring/database/migrations composer remove uptd-pelita/laravel-queue-monitoring rm -f config/queue-monitor.php
License
MIT. See LICENSE.