"""Health and Diagnostics API Endpoints."""
from __future__ import annotations

from typing import Any

from fastapi import APIRouter

from backend.app.monitoring.health import health_service
from backend.app.monitoring.metrics import metrics_collector

router = APIRouter(prefix="/health", tags=["Health"])


@router.get("")
async def get_health() -> dict[str, Any]:
    """Retrieve full system health, connection states, and kill switch status."""
    return health_service.check_health()


@router.get("/metrics")
async def get_metrics() -> dict[str, Any]:
    """Retrieve operational latency and execution counts."""
    return metrics_collector.get_summary()
