monitoring: Betriebsüberwachung Phase 1 — GlitchTip (Server- und Browserfehler), Fehlersignale ohne Exception, /health mit Scheduler-Herzschlag, ntfy-Alarme, fehlgeschlagene Anmeldungen im Verlauf, Umami im Kundenbereich, Versionsnummer
- GlitchTip über die Sentry-SDKs; Datenschutzfilter (nur User-ID, keine
Request-Bodys, Tokens aus URL/Query/Referer, E-Mails aus Meldungen).
Browser-SDK erst beim ersten Fehler nachgeladen.
- ReportErrorSignals: tote interne Links (404 mit eigenem Referrer), 403/429
für Angemeldete, 419 als gedrosselte Warnung.
- /health (Bearer-Token): DB, Cache, Queue-Rückstau, Scheduler-Herzschlag,
Plattenplatz → 200/503; Scheduler und Plattenplatz auch im Systemstatus.
- OperationalAlert zusätzlich per ntfy (JSON-POST), unabhängig von der Mail.
- Verlauf: login_failed (Grund unbekannt/kein Passwort/falsch),
login_lockout, two_factor_failed; IP nur als gekürzter HMAC.
- Umami: Kundenbereich mit eigenem Schalter und identify('user-<id>'),
nie im Admin/bei Impersonation; Query-Filter auch auf den Webseiten
(signierte Links gingen bisher an Umami).
- queue:prune-failed nach 30 Tagen.
- Versionsnummer: config('app.version') aus APP_VERSION oder Datei RELEASE
(git describe --tags), in GlitchTip, /health, Systemstatus, artisan about.
Plan: dev/betrieb/monitoring-plan.md (Entscheidungen M1–M9).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2079dfdaa8
commit
d884eb7482
42 changed files with 1896 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Controllers\HealthController;
|
||||
use App\Http\Middleware\BasicAuthMiddleware;
|
||||
use App\Http\Middleware\EnsureSessionIsNotRevoked;
|
||||
use App\Http\Middleware\LogApiUsage;
|
||||
|
|
@ -7,6 +8,7 @@ use App\Http\Middleware\RecordMailLinkClick;
|
|||
use App\Http\Middleware\RedirectPortalOnlyPagesFromHub;
|
||||
use App\Http\Middleware\RedirectWwwToApex;
|
||||
use App\Http\Middleware\RejectLegacyApiKeys;
|
||||
use App\Http\Middleware\ReportErrorSignals;
|
||||
use App\Http\Middleware\SecurityHeaders;
|
||||
use App\Http\Middleware\SetCurrentPortal;
|
||||
use App\Http\Middleware\SetEdition;
|
||||
|
|
@ -17,6 +19,7 @@ use Illuminate\Http\Request;
|
|||
use Illuminate\Support\Facades\Route;
|
||||
use Laravel\Sanctum\Http\Middleware\CheckAbilities;
|
||||
use Laravel\Sanctum\Http\Middleware\CheckForAnyAbility;
|
||||
use Sentry\Laravel\Integration;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
|
|
@ -28,6 +31,12 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
// Legacy-API-Aliasse (/service/… ohne /api-Präfix) in der
|
||||
// api-Middleware-Gruppe — Übernahme bestehender Integrationen.
|
||||
Route::middleware('api')->group(__DIR__.'/../routes/legacy-api.php');
|
||||
|
||||
// Tiefer Health-Check für den externen Monitor (Monitoring-Plan
|
||||
// 1.5) — ohne web-/api-Gruppe: keine Session, kein API-Log.
|
||||
Route::get('/health', HealthController::class)
|
||||
->middleware('throttle:30,1')
|
||||
->name('health.deep');
|
||||
},
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
|
|
@ -40,6 +49,11 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
// Security-Header auf allen Antworten (Web + API), Proxy-unabhängig.
|
||||
$middleware->append(SecurityHeaders::class);
|
||||
|
||||
// Fehler ohne Exception (tote interne Links, 403/429 für Angemeldete,
|
||||
// 419) als GlitchTip-Warnung — global, weil 404 vor jedem Routing
|
||||
// entsteht (Monitoring-Plan 1.3).
|
||||
$middleware->append(ReportErrorSignals::class);
|
||||
|
||||
// Portal-Kontext nach dem Theme-Provider setzen (liest config('app.theme'))
|
||||
$middleware->append(SetCurrentPortal::class);
|
||||
|
||||
|
|
@ -143,5 +157,9 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
}, subdomains: false);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
// Gemeldete Exceptions zusätzlich an GlitchTip (Monitoring-Plan 1.1).
|
||||
// Ohne SENTRY_LARAVEL_DSN ein No-op; Laravels dontReport-Liste (404,
|
||||
// Validierung, Auth) gilt weiter — diese Fälle meldet
|
||||
// ReportErrorSignals gezielt als Warnung.
|
||||
Integration::handles($exceptions);
|
||||
})->create();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue