2017 © Pedro Peláez
 

library laravel-queue-monitor

Laravel queue monitoring tools

image

tremby/laravel-queue-monitor

Laravel queue monitoring tools

  • Monday, November 20, 2017
  • by tremby
  • Repository
  • 2 Watchers
  • 46 Stars
  • 22,019 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 0 Open issues
  • 24 Versions
  • 8 % Grown

The README.md

Laravel queue monitor

This adds various tools to a project for monitoring its queue., (*1)

Laravel version

This branch and the 2.* line of tags are for Laravel 5. For the Laravel 4 version see the laravel4 branch and the 1.* line of tags., (*2)

If you are using Laravel 5.5 or later, and are using PHP 7.1 or later, and your queue is backed by Redis, you may instead consider using Laravel Horizon, which is an official tool and solves the same issue as this package., (*3)

Installation

Require it in your Laravel project:, (*4)

composer require tremby/laravel-queue-monitor

If you're running Laravel 5.4 or below, you have to register the service provider manually in your config/app.php file:, (*5)

'providers' => [
    ...
    Tremby\QueueMonitor\ServiceProvider::class,
],

Use

Add a cron job which runs the queue:queuecheck Artisan task for each queue you want to monitor. A queue name can be passed as an argument, or the default queue name is used if none is given. See ./artisan queue:queuecheck --help for full details., (*6)

Example cron job to check the default queue every 15 minutes:, (*7)

*/15 * * * * php /home/forge/example.com/artisan queue:queuecheck

This task records in the application cache (for one day) that a check for this queue is pending, then pushes a job to this queue. This job changes that cached status to "OK", so if the job doesn't run for whatever reason the status will be left at "pending"., (*8)

The status of all queue monitors can be checked by rendering one of the provided status views. The markup of the provided views are Twitter Bootstrap-friendly and if the status-page view is used Bootstrap is loaded from a CDN., (*9)

Route::get('queue-monitor', function () {
    return Response::view('queue-monitor::status-page');
});

Other views available are queue-monitor::status-panel, which is the .panel element and its contents; and queue-monitor::status, which is just the table element. Either of these could be used to plug this monitor into a larger monitoring panel. A panel_class option can be passed, which defaults to panel-default., (*10)

There's also queue-monitor::status-json, which renders JSON suitable for machine consumption. This allows rendering options to be passed to the underlying json_encode and can be used like this:, (*11)

Route::get('queue-monitor.json', function () {
    $response = Response::view('queue-monitor::status-json', [
        'options' => \JSON_PRETTY_PRINT,
    ]);
    $response->header('Content-Type', 'application/json');
    return $response;
});

In practice you might set the cron job to run every 15 minutes, and then automate another job (such as with a remote health checker) to run a few minutes later, consume the JSON, and ensure all queues have the ok status. If any don't, it could send an alert with a link to the HTML queue status view. It could also check that the date at which the last check was queued is reasonable, and so that the cron job has not stopped working., (*12)

The Versions

20/11 2017

dev-master

9999999-dev

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

20/11 2017

dev-microsecond-bug

dev-microsecond-bug

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

20/11 2017

2.3.7

2.3.7.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

13/11 2017

2.3.6

2.3.6.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

10/11 2017

2.3.5

2.3.5.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

07/11 2017

v2.3.4

2.3.4.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

29/03 2017

2.3.3

2.3.3.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

23/02 2017

2.3.2

2.3.2.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

23/02 2017

2.3.1

2.3.1.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

28/08 2015

dev-laravel4

dev-laravel4

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

28/08 2015

1.3.1

1.3.1.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

19/08 2015

1.3

1.3.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

19/08 2015

dev-laravel5

dev-laravel5

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

19/08 2015

2.3

2.3.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

17/08 2015

1.2.1

1.2.1.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

17/08 2015

2.2.1

2.2.1.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

17/08 2015

2.2

2.2.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

17/08 2015

1.2

1.2.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

15/08 2015

2.1

2.1.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

15/08 2015

1.1

1.1.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

15/08 2015

1.0

1.0.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

15/08 2015

2.0

2.0.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

15/08 2015

0.9.1

0.9.1.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel

15/08 2015

0.9

0.9.0.0

Laravel queue monitoring tools

  Sources   Download

MIT

The Requires

 

by Bart Nagel