spatie/laravel-health
Monitor your Laravel app’s health by registering checks (disk space, etc.) with warning/fail thresholds. Get notified via mail or Slack when checks degrade, and extend with custom checks for proactive alerting.
This check will monitor the amount of errors and exceptions your application throws. For this check you'll need to have an account on Flare.
By default, this check will send:
To start using this check, you should have a Flare API Token and Flare project id. Check the Flare docs on how to get these values.
Here's how you can register the check.
use Spatie\Health\Facades\Health;
use Spatie\Health\Checks\Checks\FlareErrorOccurrenceCountCheck;
Health::checks([
FlareErrorOccurrenceCountCheck::new()
->apiToken($flareApiToken)
->projectId($flareProjectId),
]);
To customize the amount of errors that triggers a warning/failure, you can call warnWhenMoreErrorsReceivedThan, and failWhenMoreErrorsReceivedThan.
FlareErrorOccurrenceCountCheck::new()
->warnWhenMoreErrorsReceivedThan(20)
->failWhenMoreErrorsReceivedThan(50),
How can I help you explore Laravel packages today?