ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend
Monitoring: Adjust health-check thresholds
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18
- Forks
- 10
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the production health-check threshold and comparing it with the staging configuration, which uses threshold 3. Review the next alert window using server logs and Sentry, checking known endpoints and actual request statuses. Done means the production threshold is set to 3, false alarms are handled as described, and the staging Sentry cron behavior has been investigated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, python
- Domain
- backend, devops, observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100