eigent/backend/app/controller/health_controller.py
Wendong-Fan 4161871b86 Improve logging with structured output across backend services
- Add detailed structured logging in Workforce initialization and task execution
- Include task metadata, API task IDs, and execution context in log entries
- Enhance error logging with better context and exception info
- Standardize log format across workforce, health controller, and other components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 14:43:31 +08:00

22 lines
685 B
Python

from fastapi import APIRouter
from pydantic import BaseModel
from utils import traceroot_wrapper as traceroot
logger = traceroot.get_logger("health_controller")
router = APIRouter(tags=["Health"])
class HealthResponse(BaseModel):
status: str
service: str
@router.get("/health", name="health check", response_model=HealthResponse)
async def health_check():
"""Health check endpoint for verifying backend is ready to accept requests."""
logger.debug("Health check requested")
response = HealthResponse(status="ok", service="eigent")
logger.debug("Health check completed", extra={"status": response.status, "service": response.service})
return response