ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend

Monitoring: Adjust health-check thresholds

Abierto
#1,111 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
18
Forks
10
Merge medio
2 d 20 h
PR fusionados (30 d)
14

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza localizando el umbral del health-check de producción y comparándolo con la configuración de staging, que usa el umbral 3. Revisa la próxima ventana de alertas mediante los logs del servidor y Sentry, comprobando los endpoints conocidos y los estados reales de las solicitudes. Se considera terminado cuando el umbral de producción está establecido en 3, las falsas alarmas se gestionan como se describe y se ha investigado el comportamiento del cron de Sentry en staging.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
fastapi, python
Área
backend, devops, observability-sre
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.