Interface HealthIndicator
- All Known Implementing Classes:
BasicAliveHealthIndicator,DatabaseHealthIndicator,DiskSpaceHealthIndicator,MemoryHealthIndicator
public interface HealthIndicator
Interface for components that can perform health checks.
Implementations should check a specific aspect of the system (database,
memory, disk, external service, etc.) and return a result indicating
whether that component is healthy.
-
Method Summary
Modifier and TypeMethodDescriptionExecute the health check.getName()Get the unique name for this health indicator.
-
Method Details
-
getName
String getName()Get the unique name for this health indicator. This name will be used as the key in the health response JSON.- Returns:
- indicator name (e.g., "database", "memory", "diskSpace")
-
check
Execute the health check. Implementations should: 1. Perform the check as quickly as possible (respecting timeouts) 2. Return UP, DOWN, DEGRADED, or UNKNOWN status 3. Include relevant details in the result 4. Handle exceptions gracefully (return UNKNOWN status)- Parameters:
qInstance- the QInstance for accessing backends, configuration, etc.- Returns:
- health check result with status and details
- Throws:
QException- if the check fails catastrophically
-