illuma-law / healthcheck-operations
Focused operations backlog health check for Spatie's Laravel Health package.
Package info
github.com/illuma-law/healthcheck-operations
pkg:composer/illuma-law/healthcheck-operations
Fund package maintenance!
Requires
- php: ^8.3
- illuminate/contracts: ^11.0||^12.0||^13.0
- illuminate/database: ^11.0||^12.0||^13.0
- illuminate/support: ^11.0||^12.0||^13.0
- spatie/laravel-health: ^1.39
- spatie/laravel-package-tools: ^1.16
- timokoerber/laravel-one-time-operations: *
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.1.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
README
A focused operations backlog health check for Spatie's Laravel Health package.
This package provides a simple, direct health check to verify that your Laravel One-Time Operations are being processed and don't remain pending for too long.
Features
- Pending Operations Detection: Automatically detects if there are any pending one-time operations waiting to be processed.
- Aging Backlog Check: Monitors the age of the oldest pending operation. If operations are older than 24 hours, the check will degrade to a Failed state.
- Detailed Meta: Reports the count of pending operations, the age of the oldest one, and a sample of operation filenames.
Installation
Require this package with composer:
composer require illuma-law/healthcheck-operations
Usage & Integration
Register the check inside your application's health service provider (e.g. AppServiceProvider or a dedicated HealthServiceProvider), alongside your other Spatie Laravel Health checks:
Basic Registration
use IllumaLaw\HealthCheckOperations\OperationsBacklogCheck; use Spatie\Health\Facades\Health; Health::checks([ OperationsBacklogCheck::new(), ]);
Expected Result States
The check interacts with the Spatie Health dashboard and JSON endpoints using these states:
- Ok: There are no pending one-time operations.
- Warning: There are pending operations, but they are relatively new (under 24 hours).
- Failed: There are pending operations that have been sitting unprocessed for more than 24 hours.
Testing
Run the test suite:
composer test
License
The MIT License (MIT). Please see License File for more information.