prevplan / laravel-heartbeat-status
Monitor Laravel queue and schedule status
Installs: 10 711
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 17
Requires
- php: ^8.1
- illuminate/contracts: ^9.0|^10.0
- spatie/laravel-package-tools: ^1.14.1
Requires (Dev)
- laravel/pint: ^1.5
- nunomaduro/collision: ^6.4
- nunomaduro/larastan: ^2.4.1
- orchestra/testbench: ^7.22
- pestphp/pest: ^1.22
- pestphp/pest-plugin-laravel: ^1.4
- phpstan/extension-installer: ^1.2
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpunit/phpunit: ^9.6
- spatie/laravel-ray: ^1.32
- dev-main
- v1.0.x-dev
- v1.0.1
- v1.0.0
- dev-renovate/major-phpstan-packages
- dev-renovate/pestphp-pest-3.x
- dev-renovate/pestphp-pest-plugin-laravel-3.x
- dev-dependabot/composer/nunomaduro/collision-tw-8.4
- dev-dependabot/composer/pestphp/pest-tw-2.35
- dev-dependabot/composer/laravel/pint-tw-1.17
- dev-dependabot/composer/orchestra/testbench-tw-9.2
- dev-dependabot/composer/phpunit/phpunit-tw-11.2
- dev-dependabot/composer/larastan/larastan-tw-2.9.8
- dev-dependabot/github_actions/dependabot/fetch-metadata-2.2.0
- dev-renovate/dependabot-fetch-metadata-2.x
- dev-dependabot/composer/spatie/laravel-ray-tw-1.37
- dev-dependabot/composer/phpstan/extension-installer-tw-1.4
- dev-dependabot/composer/phpstan/phpstan-deprecation-rules-tw-1.2
- dev-dependabot/composer/phpstan/phpstan-phpunit-tw-1.4
- dev-renovate/phpunit-phpunit-11.x
This package is auto-updated.
Last update: 2024-11-15 12:15:54 UTC
README
A simple package to monitor the queue heartbeat and the schedule of a Laravel Site.
It provides a route with a status and a 200 or 503 HTTP state that can be monitored by uptime services such as upptime.
Tested with Laravel 9 + 10.
Installation
You can install the package via composer:
composer require prevplan/laravel-heartbeat-status
The standard URL is yoursite.com/heartbeat
. If you want to change this, add
Route::heartbeat_status('new-folder');
to your routes/web.php
.
You can optionally publish the config file with:
php artisan vendor:publish --tag="laravel-heartbeat-status-config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | Heartbeat Interval Time |-------------------------------------------------------------------------- | | Time in minutes between queued heartbeatStatusCommand jobs. | */ 'heart-rate' => env('HEARTBEAT_HEART_RATE', 2), /* |-------------------------------------------------------------------------- | Heartbeat Emergency Time |-------------------------------------------------------------------------- | | Time in minutes to report failure/change to status 503, if the | last heartbeatStatusCommand is older than this value | */ 'emergency_time' => env('HEARTBEAT_EMERGENCY', 5), /* |-------------------------------------------------------------------------- | Schedule Leeway |-------------------------------------------------------------------------- | | Time for schedule running tolerance in seconds | */ 'schedule_leeway' => env('HEARTBEAT_SCHEDULE_LEEWAY', 10), /* |-------------------------------------------------------------------------- | Queue Leeway |-------------------------------------------------------------------------- | | Time for queue running tolerance in seconds | */ 'queue_leeway' => env('HEARTBEAT_QUEUE_LEEWAY', 20), ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="laravel-heartbeat-status-views"
Usage
The status page is automatically published under yoursite.com/heartbeat or another URL if you’ve changed it.
It checks the last run of the schedule and the queue.
If everything works fine, it responds to a 200 HTTP state. If there is a problem a 503 HTTP state will be shown.
You can monitor this heartbeat page with upptime or another uptime service of your choice.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.