feat: add router health metrics to node_cache and node-guardian

- Add migration 042_node_cache_router_metrics.sql
- Node guardian now collects router health and sends in heartbeat
- City-service uses cached router_healthy from node_cache
- This allows NODE2 router status to be displayed correctly
This commit is contained in:
Apple
2025-12-01 08:03:46 -08:00
parent 9b9a72ffbd
commit a818f2ac2f
4 changed files with 108 additions and 5 deletions

View File

@@ -3373,7 +3373,7 @@ async def get_node_endpoints(node_id: str) -> Dict[str, str]:
async def get_node_metrics(node_id: str) -> Optional[Dict[str, Any]]:
"""
Отримати розширені метрики ноди (включаючи Swapper).
Отримати розширені метрики ноди (включаючи Swapper та Router).
"""
pool = await get_pool()
@@ -3385,7 +3385,9 @@ async def get_node_metrics(node_id: str) -> Optional[Dict[str, Any]]:
swapper_models_total,
swapper_state,
router_url,
swapper_url
swapper_url,
router_healthy,
router_version
FROM node_cache
WHERE node_id = $1
""", node_id)