--- 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)