python_outbox_core.health_check =============================== .. py:module:: python_outbox_core.health_check .. autoapi-nested-parse:: Health check interface for outbox monitoring. Best Practices Applied: 1. Standard health check contract 2. Multi-level status (healthy/degraded/unhealthy) 3. Detailed diagnostics for debugging 4. Prometheus-compatible metrics References: - Health Check API: https://microservices.io/patterns/observability/health-check-api.html Classes ------- .. autoapisummary:: python_outbox_core.health_check.HealthStatus python_outbox_core.health_check.OutboxHealthCheck Module Contents --------------- .. py:class:: HealthStatus Bases: :py:obj:`str`, :py:obj:`enum.Enum` Health status levels. .. py:attribute:: HEALTHY :value: 'healthy' .. py:attribute:: DEGRADED :value: 'degraded' .. py:attribute:: UNHEALTHY :value: 'unhealthy' .. py:class:: OutboxHealthCheck Bases: :py:obj:`abc.ABC` Health check for outbox worker. Projects implement this to expose health endpoints. Useful for K8s liveness/readiness probes. .. py:method:: check_health() -> Dict[str, Any] :abstractmethod: :async: Perform health check. Returns dict with status, timestamp, checks. .. py:method:: check_database() -> Dict[str, Any] :async: Check if database is reachable. .. py:method:: check_broker() -> Dict[str, Any] :async: Check if message broker is reachable. .. py:method:: check_outbox_lag() -> Dict[str, Any] :async: Check outbox processing lag. Returns unhealthy if too many pending events.