DOCS/workflow/04_scheduler/scheduled_healthcheck_alert.md
happybell80 f078b28ced docs: 03_rag + 04_scheduler + 05_admin 워크플로우 현행화
03_rag:
- companyx_grounding_pipeline.md: 코드 SSOT 섹션 추가, 진입 조건 3단계(IC→마커 폴백) 정확히 기술, 환경변수 참조로 IP 하드코딩 제거
- companyx_incremental_indexing_workflow.md: frontmatter 표준 적용 (type, last_updated)
- rag_upload_indexing_pipeline.md: 코드 SSOT·재인덱싱·업로드 경로별 진입점 테이블 추가, 환경변수 참조

04_scheduler:
- scheduled_daily_briefing.md: n8n cron 전제 제거, APScheduler DB 기반 + LangGraph 워크플로우 기준 재작성
- scheduled_healthcheck_alert.md: n8n cron 전제 제거, /health 엔드포인트 + SKILL.md registry 기반 재작성
- scheduled_rag_reindex_retry.md: 현행 코드에 해당 잡 없음 → _archive 이동

05_admin:
- diary_reflection_pipeline.md: n8n 전제 제거, APScheduler + diary_generator.py 기준 재작성, /api/diary/generate(존재하지 않는 엔드포인트) 제거

Refs: DOCS#8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 07:52:29 +09:00

71 lines
2.3 KiB
Markdown

---
tags: [workflow, scheduler, healthcheck, monitoring]
type: workflow
last_updated: 2026-04-06
---
# scheduled_healthcheck_alert 워크플로우
## 목적
rb8001의 `/health` 엔드포인트를 통해 모든 외부 스킬 서비스와 인프라의 상태를 확인한다.
## 아키텍처
- **엔드포인트**: `GET /health` (`app/router/system_endpoint.py`)
- **라우터 인스턴스**: `RobeingRouter.get_service_status()` (`app/router/router.py`)
- **n8n 미사용**. rb8001이 FastAPI 엔드포인트로 직접 제공.
## 코드 SSOT
- `rb8001/app/router/system_endpoint.py``/health` 엔드포인트 정의
- `rb8001/app/router/router.py``get_service_status()` 구현
## 헬스체크 흐름
```
GET /health
→ system_endpoint.health_check()
→ router_instance.get_service_status()
→ registry.load_all() [SKILL.md 기반 스킬 목록]
→ 각 external_http 스킬: GET {skill_url}/health (timeout 5초)
→ GET {STATE_SERVICE_URL}/healthz (state 서비스)
→ brain 상태 확인 (decision_engine 초기화 여부)
→ 응답 조립
```
## 응답 형식
```json
{
"status": "healthy",
"robeing_id": "{settings.ROBEING_ID}",
"services": {
"skill-news": true,
"skill-rag-file": true,
"skill-calendar": false,
"state": true,
"brain": true,
"brain_stats": { "..." : "..." }
},
"brain": "integrated",
"memory_store": "postgresql",
"memory_limit": "{settings.MAX_MEMORY_SIZE}MB"
}
```
## 스킬 상태 확인 방식
- `registry.load_all()`이 SKILL.md frontmatter에서 `runtime_kind=external_http`인 스킬 목록을 로드한다.
- 각 스킬의 `resolve_url()`로 URL을 해소한 뒤 `GET {url}/health`를 호출한다 (timeout 5초).
- HTTP 200이면 `true`, 그 외 또는 예외 시 `false`.
## 실패 분기
- `router_instance``None`이면 HTTP 503 반환.
- 개별 스킬 헬스체크 실패는 해당 스킬만 `false`로 표시하고, 전체 응답은 정상 반환.
- 전체 예외 발생 시 HTTP 503 + 상세 메시지 반환.
## 환경변수
- `STATE_SERVICE_URL` — state 서비스 URL (settings 경유).
- `ROBEING_ID` — 로빙 식별자 (settings 경유).
- `MAX_MEMORY_SIZE` — 메모리 한도 (settings 경유).
## 관련 문서
- [service_health_check (레거시, _archive 이동됨)](../_archive/service_health_check.md)