Health check ¶
Installing https://spatie.be/docs/laravel-health/v1/introduction as an initial ‘health check provider’ system.
configuration ¶
config/health.php
This file configures ‘fail notifications’ to notify a slack handler. This means we’ll need at least one slack webhook URL to point to ‘major incident’ (or similar). Unsure if we need separate slack hooks for nonprod/testing.
issue ¶
'notifications' => [
Spatie\Health\Notifications\CheckFailedNotification::class => ['slack'],
],
is provided in config/health.php
While it looks like an array (and is an array), adding more than one item doesn’t work.
The last item is always chosen, and there doesn’t seem to be a way to make it notify
both slack and mail at the same time (have verified that each works individually).
This might be worth submitting a bug for, but the package owner also sells a
more complete notification service they want you to subscribe to, so.. that may be why.
(bug #86 submitted to their repo)
env ¶
HEALTHCHECK_EMAILS
HEALTHCHECK_SLACK_WEBHOOK
were added to .env. config/core.php picks up these environment variables via
'healthcheck' => [
'email' => env('HEALTHCHECK_EMAILS', ''),
'slack_webhook' => env('HEALTHCHECK_SLACK_WEBHOOK', ''),
],
and config/health.php references the config(‘core....’) values.
for deployment ¶
HEALTHCHECK_SLACK_WEBHOOK is likely the only environment var needed to be added to deployment process.