Alarm-Mail bei fehlgeschlagenen geplanten Aufgaben und Queue-Jobs

- OperationalAlert: Log (Kanal monitoring) immer, Mail an
  MONITORING_ALERT_EMAIL (Standard EXCEPTION_MAIL), optional ntfy;
  gleiche Meldung hoechstens einmal pro Stunde
- Kernel: onFailure fuer alle geplanten Aufgaben (auch kuenftige)
- AppServiceProvider: Queue::failing
- withoutOverlapping mit kurzen Sperrdauern (10-60 Min.) statt 24 h

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-10-08 09:49:18 +00:00
parent fdbb4f3853
commit c9cd17a41a
7 changed files with 300 additions and 4 deletions

View file

@ -34,6 +34,12 @@ return [
'channels' => [
'monitoring' => [
'driver' => 'daily',
'path' => storage_path('logs/monitoring.log'),
'level' => 'debug',
'days' => 30,
],
'order_controller' => [
'driver' => 'daily',
'path' => storage_path('logs/order_controller.log'),

View file

@ -22,6 +22,29 @@ return [
'failed_jobs_window_hours' => 24,
],
/*
|--------------------------------------------------------------------------
| Betriebs-Alerts
|--------------------------------------------------------------------------
|
| Fehlgeschlagene geplante Aufgaben und Queue-Jobs: immer `critical` ins
| Log (Kanal monitoring), dazu Best-Effort-Mail und optional ntfy-Push.
| Gleiche Meldungen gehen höchstens einmal je `throttle_minutes` raus.
|
*/
'alerts' => [
'enabled' => (bool) env('MONITORING_ALERTS_ENABLED', true),
'mail_to' => env('MONITORING_ALERT_EMAIL', env('EXCEPTION_MAIL', 'exception@adametz.media')),
'throttle_minutes' => (int) env('MONITORING_ALERT_THROTTLE_MINUTES', 60),
'ntfy' => [
'url' => env('MONITORING_NTFY_URL'),
'topic' => env('MONITORING_NTFY_TOPIC'),
'token' => env('MONITORING_NTFY_TOKEN'),
'priority' => (int) env('MONITORING_NTFY_PRIORITY', 4),
],
],
'scheduler' => [
'heartbeat_warn_minutes' => 3,
'heartbeat_critical_minutes' => 10,