|
| 1 | +<?php |
| 2 | + |
| 3 | +return [ |
| 4 | + /* |
| 5 | + * A result store is responsible for saving the results of the checks. The |
| 6 | + * `EloquentHealthResultStore` will save results in the database. You |
| 7 | + * can use multiple stores at the same time. |
| 8 | + */ |
| 9 | + 'result_stores' => [ |
| 10 | + Spatie\Health\ResultStores\EloquentHealthResultStore::class => [ |
| 11 | + 'connection' => env('HEALTH_DB_CONNECTION', env('DB_CONNECTION')), |
| 12 | + 'model' => Spatie\Health\Models\HealthCheckResultHistoryItem::class, |
| 13 | + 'keep_history_for_days' => 5, |
| 14 | + ], |
| 15 | + |
| 16 | + /* |
| 17 | + Spatie\Health\ResultStores\CacheHealthResultStore::class => [ |
| 18 | + 'store' => 'file', |
| 19 | + ], |
| 20 | +
|
| 21 | + Spatie\Health\ResultStores\JsonFileHealthResultStore::class => [ |
| 22 | + 'disk' => 's3', |
| 23 | + 'path' => 'health.json', |
| 24 | + ], |
| 25 | +
|
| 26 | + Spatie\Health\ResultStores\InMemoryHealthResultStore::class, |
| 27 | + */ |
| 28 | + ], |
| 29 | + |
| 30 | + /* |
| 31 | + * You can get notified when specific events occur. Out of the box you can use 'mail' and 'slack'. |
| 32 | + * For Slack you need to install laravel/slack-notification-channel. |
| 33 | + */ |
| 34 | + 'notifications' => [ |
| 35 | + /* |
| 36 | + * Notifications will only get sent if this option is set to `true`. |
| 37 | + */ |
| 38 | + 'enabled' => true, |
| 39 | + |
| 40 | + 'notifications' => [ |
| 41 | + Spatie\Health\Notifications\CheckFailedNotification::class => ['mail'], |
| 42 | + ], |
| 43 | + |
| 44 | + /* |
| 45 | + * Here you can specify the notifiable to which the notifications should be sent. The default |
| 46 | + * notifiable will use the variables specified in this config file. |
| 47 | + */ |
| 48 | + 'notifiable' => Spatie\Health\Notifications\Notifiable::class, |
| 49 | + |
| 50 | + /* |
| 51 | + * When checks start failing, you could potentially end up getting |
| 52 | + * a notification every minute. |
| 53 | + * |
| 54 | + * With this setting, notifications are throttled. By default, you'll |
| 55 | + * only get one notification per hour. |
| 56 | + */ |
| 57 | + 'throttle_notifications_for_minutes' => 60, |
| 58 | + 'throttle_notifications_key' => 'health:latestNotificationSentAt:', |
| 59 | + |
| 60 | + 'mail' => [ |
| 61 | + 'to' => 'your@example.com', |
| 62 | + |
| 63 | + 'from' => [ |
| 64 | + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), |
| 65 | + 'name' => env('MAIL_FROM_NAME', 'Example'), |
| 66 | + ], |
| 67 | + ], |
| 68 | + |
| 69 | + 'slack' => [ |
| 70 | + 'webhook_url' => env('HEALTH_SLACK_WEBHOOK_URL', ''), |
| 71 | + |
| 72 | + /* |
| 73 | + * If this is set to null the default channel of the webhook will be used. |
| 74 | + */ |
| 75 | + 'channel' => null, |
| 76 | + |
| 77 | + 'username' => null, |
| 78 | + |
| 79 | + 'icon' => null, |
| 80 | + ], |
| 81 | + ], |
| 82 | + |
| 83 | + /* |
| 84 | + * You can let Oh Dear monitor the results of all health checks. This way, you'll |
| 85 | + * get notified of any problems even if your application goes totally down. Via |
| 86 | + * Oh Dear, you can also have access to more advanced notification options. |
| 87 | + */ |
| 88 | + 'oh_dear_endpoint' => [ |
| 89 | + 'enabled' => false, |
| 90 | + |
| 91 | + /* |
| 92 | + * When this option is enabled, the checks will run before sending a response. |
| 93 | + * Otherwise, we'll send the results from the last time the checks have run. |
| 94 | + */ |
| 95 | + 'always_send_fresh_results' => true, |
| 96 | + |
| 97 | + /* |
| 98 | + * The secret that is displayed at the Application Health settings at Oh Dear. |
| 99 | + */ |
| 100 | + 'secret' => env('OH_DEAR_HEALTH_CHECK_SECRET'), |
| 101 | + |
| 102 | + /* |
| 103 | + * The URL that should be configured in the Application health settings at Oh Dear. |
| 104 | + */ |
| 105 | + 'url' => '/oh-dear-health-check-results', |
| 106 | + ], |
| 107 | + |
| 108 | + /* |
| 109 | + * You can specify a heartbeat URL for the Horizon check. |
| 110 | + * This URL will be pinged if the Horizon check is successful. |
| 111 | + * This way you can get notified if Horizon goes down. |
| 112 | + */ |
| 113 | + 'horizon' => [ |
| 114 | + 'heartbeat_url' => env('HORIZON_HEARTBEAT_URL', null), |
| 115 | + ], |
| 116 | + |
| 117 | + /* |
| 118 | + * You can specify a heartbeat URL for the Schedule check. |
| 119 | + * This URL will be pinged if the Schedule check is successful. |
| 120 | + * This way you can get notified if the schedule fails to run. |
| 121 | + */ |
| 122 | + 'schedule' => [ |
| 123 | + 'heartbeat_url' => env('SCHEDULE_HEARTBEAT_URL', null), |
| 124 | + ], |
| 125 | + |
| 126 | + /* |
| 127 | + * You can specify a heartbeat URL for the Reverb check. |
| 128 | + * This URL will be pinged if the Reverb check is successful. |
| 129 | + * This way you can get notified if Reverb goes down. |
| 130 | + */ |
| 131 | + 'reverb' => [ |
| 132 | + 'heartbeat_url' => env('REVERB_HEARTBEAT_URL', null), |
| 133 | + ], |
| 134 | + |
| 135 | + /* |
| 136 | + * You can set a theme for the local results page |
| 137 | + * |
| 138 | + * - light: light mode |
| 139 | + * - dark: dark mode |
| 140 | + */ |
| 141 | + 'theme' => 'light', |
| 142 | + |
| 143 | + /* |
| 144 | + * When enabled, completed `HealthQueueJob`s will be displayed |
| 145 | + * in Horizon's silenced jobs screen. |
| 146 | + */ |
| 147 | + 'silence_health_queue_job' => true, |
| 148 | + |
| 149 | + /* |
| 150 | + * The response code to use for HealthCheckJsonResultsController when a health |
| 151 | + * check has failed |
| 152 | + */ |
| 153 | + 'json_results_failure_status' => 200, |
| 154 | + |
| 155 | + /* |
| 156 | + * You can specify a secret token that needs to be sent in the X-Secret-Token for secured access. |
| 157 | + */ |
| 158 | + 'secret_token' => env('HEALTH_SECRET_TOKEN') ?? null, |
| 159 | + |
| 160 | +/** |
| 161 | + * By default, conditionally skipped health checks are treated as failures. |
| 162 | + * You can override this behavior by uncommenting the configuration below. |
| 163 | + * |
| 164 | + * @link https://spatie.be/docs/laravel-health/v1/basic-usage/conditionally-running-or-modifying-checks |
| 165 | + */ |
| 166 | + // 'treat_skipped_as_failure' => false |
| 167 | +]; |
0 commit comments