ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend
Monitoring: Adjust health-check thresholds
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 18
- Forks
- 10
- Merge moyen
- 2 j 20 h
- PR mergées (30 j)
- 14
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par localiser le seuil du health-check de production et le comparer à la configuration de staging, qui utilise le seuil 3. Examinez la prochaine fenêtre d’alerte à l’aide des logs du serveur et de Sentry, en vérifiant les endpoints connus et les statuts réels des requêtes. La tâche est terminée lorsque le seuil de production est défini à 3, que les fausses alertes sont traitées comme indiqué et que le comportement du cron Sentry de staging a été étudié.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- fastapi, python
- Domaine
- backend, devops, observability-sre
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100