ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend

Monitoring: Adjust health-check thresholds

Aperta
#1,111 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
18
Fork
10
Merge medio
2g 20h
PR unite (30g)
14

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia individuando la soglia dell’health-check di produzione e confrontandola con la configurazione di staging, che usa la soglia 3. Esamina la prossima finestra di alert utilizzando i log del server e Sentry, verificando gli endpoint noti e gli status effettivi delle richieste. Il lavoro è completato quando la soglia di produzione è impostata su 3, i falsi allarmi vengono gestiti come descritto e il comportamento del cron di Sentry in staging è stato analizzato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
fastapi, python
Ambito
backend, devops, observability-sre
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.