An addon that adds healthchecks to any Statamic application and integrates seamlessly with Vigilant. It extends the Vigilant Laravel Healthchecks package and adds Statamic specific checks.
This package providers an API endpoint to check the health of your Statamic application. It returns two types of checks, health checks and metrics. Healthchecks are checks that indicate whether a specific part of your application is functioning correctly, while metrics provide numeric values that give insights on health over time. Vigilant can use these metrics to notify you of spikes or quickly increasing metrics.
Install the package via Composer:
composer require govigilant/statamic-healthchecksSet the API token in your .env file:
VIGILANT_HEALTHCHECK_TOKEN=your-vigilant-api-key-hereNote: The token is required to access the health endpoint.
Optionally publish the configuration if ou want to adjust default behavior:
php artisan vendor:publish --provider="Vigilant\LaravelHealthchecks\ServiceProvider"This creates config/vigilant-healthchecks.php.
This package automatically schedules a command and a job to verify if your sheduler and queue workers are running.
If you do not want or want to customize this behavior, you can disable the automatic scheduling in the config file by setting schedule to false.
Ensure to schedule the php artisan vigilant:scheduler-heartbeat yourself if you disable automatic scheduling.
Please refer to the Vigilant Laravel Healthchecks Readme for usage and customization instructions.
All Laravel checks in Vigilant Laravel Healthchecks are available, plus the following Statamic specific checks:
| Check | Description |
|---|---|
| StacheCheck | Verifies that the stache is built |
A ready-to-use Docker-based development environment lives in devenv/.
Ensure Docker is running, then start the stack: docker compose -f devenv/docker-compose.yml up --build.
This will create a Statamic application and link this package for development. The bearer token is set to testing and can be used to access the health endpoint:
curl -X POST "http://localhost:8000/api/vigilant/health" \
-H "Authorization: Bearer testing" \
-H "Content-Type: application/json"You may use the following credentials to log in to the Statamic control panel at http://localhost:8000/cp:
- Email:
[email protected] - Password:
admin
Run the quality checks:
composer qualityPlease review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.