ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend
Monitoring: Adjust health-check thresholds
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 18
- Forks
- 10
- Ø Merge
- 2 T. 20 Std.
- Gemergte PRs (30 T.)
- 14
Beschreibung
Is your feature request related to a problem?
Prod emits recurring "downtime detected" alerts due to misconfigured thresholds. This causes alert noise and misinterpretation of server status, which can lead to unnecessary troubleshooting efforts.
Describe the solution you'd like
- Set prod health-check threshold to 3.
- Suppress alarms after confirming ~5–6 known endpoints return 200.
- Verify server logs and status during downtime windows for accurate root cause analysis.
- Investigate Sentry cron monitor behavior on staging.
Original issue
Context
Prod emits recurring "downtime detected" alerts. Alert noise traced to threshold config: staging (backend, guardrails, frontend) uses threshold 3 and produces no false alerts; prod is on a different value. Request timeout is 15s, exponential backoff ~3–4s then ~8s, health check every 1 min.
Decisions
- Set prod health-check threshold to 3. Caveat: if the health endpoint genuinely isn't responding (prod is intermittently loaded), the threshold change only silences the symptom — write the real hypothesis (FastAPI thread saturation at ~40 threads / ~50–100 concurrent requests) into the issue so a green dashboard isn't misread as solved.
- When a downtime alarm fires, first hit ~5–6 known endpoints; if they return 200, treat as a false alarm and suppress.
Verification (before assuming bot-flood root cause)
- For each downtime window, check logs + Sentry: was the server actually down, did real LLM calls come through and with what status, did bot call volume spike? Confirm against Prajna's root cause.
- Pull logs for the next alert window and confirm actual server behavior.
Related
- A Sentry cron monitor is also firing on staging while staging is green — determine whether Sentry is misbehaving, it's the dev-env uptime check, or the notification setup is wrong.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den Schwellenwert für den Production-Health-Check zu lokalisieren und mit der Staging-Konfiguration zu vergleichen, die den Schwellenwert 3 verwendet. Überprüfe das nächste Alert-Fenster anhand von Server-Logs und Sentry und kontrolliere dabei bekannte Endpunkte und die tatsächlichen Request-Status. Fertig ist die Aufgabe, wenn der Production-Schwellenwert auf 3 gesetzt ist, Fehlalarme wie beschrieben behandelt werden und das Verhalten des Staging-Sentry-Cronjobs untersucht wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- fastapi, python
- Bereich
- backend, devops, observability-sre
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100