Spaces:
Paused
Paused
| from datetime import datetime | |
| from fastapi import APIRouter | |
| router = APIRouter(prefix="/health", tags=["health"]) | |
| async def health_check(): | |
| """Comprehensive health check endpoint""" | |
| return { | |
| "status": "healthy", | |
| "timestamp": datetime.utcnow().isoformat(), | |
| "service": "zenith-backend", | |
| "version": "1.0.0", | |
| "uptime": "operational" | |
| } | |
| async def detailed_health_check(): | |
| """Detailed health check with component status""" | |
| return { | |
| "status": "healthy", | |
| "timestamp": datetime.utcnow().isoformat(), | |
| "service": "zenith-backend", | |
| "components": { | |
| "database": "healthy", | |
| "cache": "healthy", | |
| "message_queue": "healthy", | |
| "monitoring": "operational" | |
| }, | |
| "metrics": { | |
| "response_time": "<100ms", | |
| "cpu_usage": "<50%", | |
| "memory_usage": "<70%" | |
| } | |
| } | |