ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend
Monitoring: Adjust health-check thresholds
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 18
- フォーク
- 10
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 14
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず本番環境のヘルスチェックのしきい値を特定し、しきい値 3 を使用しているステージング構成と比較します。サーバーログと Sentry を使って次のアラートウィンドウを確認し、既知のエンドポイントと実際のリクエストステータスを確認します。本番環境のしきい値が 3 に設定され、誤アラームが記載どおりに処理され、ステージングの Sentry cron の動作が調査されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- fastapi, python
- 領域
- backend, devops, observability-sre
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100