mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 11:40:25 +00:00
- 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>
22 lines
685 B
Python
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
|
|
|