Files
michaelschiemer/deployment/docs/guides/health-checks.md
Michael Schiemer 36ef2a1e2c
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
fix: Gitea Traefik routing and connection pool optimization
- Remove middleware reference from Gitea Traefik labels (caused routing issues)
- Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s)
- Add explicit service reference in Traefik labels
- Fix intermittent 504 timeouts by improving PostgreSQL connection handling

Fixes Gitea unreachability via git.michaelschiemer.de
2025-11-09 14:46:15 +01:00

2.6 KiB

Health Checks - Dokumentation

Verfügbare Health-Check-Endpoints

Basis Health-Check

  • URL: /health
  • Methode: GET
  • Zweck: Einfacher Health-Check für Load Balancer und Monitoring
  • Response: HTTP 200 wenn gesund

Erweiterte Health-Checks

1. Vollständiger System-Status

  • URL: /admin/health/api/status
  • Methode: GET
  • Zweck: Vollständiger Health-Report mit allen Checks
  • Response: JSON mit allen Health-Check-Ergebnissen

2. Health-Summary

  • URL: /admin/health/api/summary
  • Methode: GET
  • Zweck: Zusammenfassung des System-Status
  • Response: JSON mit Overall-Status und Quick-Stats

3. Einzelner Health-Check

  • URL: /admin/health/api/check/{name}
  • Methode: GET
  • Zweck: Spezifischen Health-Check ausführen
  • Response: JSON mit Check-Ergebnis

4. Health-Checks nach Kategorie

  • URL: /admin/health/api/category/{category}
  • Methode: GET
  • Zweck: Alle Checks einer Kategorie ausführen
  • Response: JSON mit Category-Report

Verfügbare Health-Checks

Das Framework unterstützt verschiedene Health-Checks:

  • Database: PostgreSQL Verbindung und Query-Test
  • Redis: Cache/Session/Queue Backend Verbindung
  • Queue: Queue Worker Status
  • Logging: Log-System Status
  • Discovery: Service Discovery Status

Verwendung in CI/CD

Der Workflow führt automatisch Health-Checks nach Deployment durch:

  1. Basic Health Check: /health Endpoint
  2. Extended Health Check: /admin/health/api/summary (falls verfügbar)

Bei fehlgeschlagenem Health-Check schlägt das Deployment fehl.

Automatischer Rollback

Geplant: Automatischer Rollback bei fehlgeschlagenem Health-Check ist noch nicht implementiert.

Aktuell: Bei fehlgeschlagenem Health-Check schlägt das Deployment fehl, aber es erfolgt kein automatischer Rollback.

Zukünftig:

  • Automatischer Rollback bei fehlgeschlagenem Health-Check
  • Rollback-Notification (Email/Slack)
  • Health-Check-Dashboard in Grafana

Monitoring Integration

Health-Checks können in Prometheus/Grafana integriert werden:

# Prometheus Scrape Config
- job_name: 'application-health'
  metrics_path: '/admin/health/api/status'
  static_configs:
    - targets: ['app:80']

Manuelle Health-Checks

# Basic Health Check
curl https://michaelschiemer.de/health

# Extended Health Summary
curl https://michaelschiemer.de/admin/health/api/summary

# Specific Check
curl https://michaelschiemer.de/admin/health/api/check/database

# All Checks
curl https://michaelschiemer.de/admin/health/api/status