Expand description
Health check system for monitoring application health
This module provides a flexible health check system for monitoring the health and readiness of your application and its dependencies.
§Example
use rustapi_core::health::{HealthCheck, HealthCheckBuilder, HealthStatus};
#[tokio::main]
async fn main() {
let health = HealthCheckBuilder::new(true)
.add_check("database", || async {
// Check database connection
HealthStatus::healthy()
})
.add_check("redis", || async {
// Check Redis connection
HealthStatus::healthy()
})
.build();
// Use health.execute().await to get results
}Structs§
- Health
Check - Health check configuration
- Health
Check Builder - Builder for health check configuration
- Health
Check Result - Overall health check result
- Health
Endpoint Config - Configuration for built-in health endpoints.
- Health
Response - JSON health response used by RustAPI’s built-in health endpoints.
Enums§
- Health
Status - Health status of a component
Functions§
- health_
response - Execute an aggregated health check and return an HTTP-friendly response.
- liveness_
response - Return a lightweight liveness probe response.
- readiness_
response - Execute a readiness probe based on the configured health checks.
Type Aliases§
- Health
Check Fn - Type alias for async health check functions