Monitoring (R5.3): Betriebs-Alerts fuer Scheduler-/Queue-Ausfaelle
OperationalAlert loggt critical + Best-Effort-Mail an MONITORING_ALERT_EMAIL (Fallback LEGAL_CONTACT_EMAIL, feature-flagged). Alle 6 Scheduler-Tasks mit onFailure, Queue::failing-Listener; .env.example: LOG_STACK=daily als Prod-Soll. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ac870a4076
commit
6984846233
8 changed files with 250 additions and 6 deletions
46
app/Mail/OperationalAlertMail.php
Normal file
46
app/Mail/OperationalAlertMail.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Betriebs-Alert an das Ops-Postfach (R5.3). Bewusst schlicht und ungebrandet:
|
||||
* es geht um schnelle, verlässliche Zustellung, nicht um CI.
|
||||
*/
|
||||
class OperationalAlertMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $summary,
|
||||
public readonly array $context = [],
|
||||
) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: '[Monitoring] '.$this->summary,
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
text: 'emails.monitoring.alert',
|
||||
with: [
|
||||
'summary' => $this->summary,
|
||||
'context' => $this->context,
|
||||
'appName' => config('app.name'),
|
||||
'environment' => config('app.env'),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue