Spring Boot Actuator automatically activates health indicators based on specific dependencies and integrates them with the /actuator/health endpoint.
Health indicators are registered through Spring Boot’s auto-configuration classes using ConditionalOnClass and ConditionalOnBean annotations.
The HealthContributorRegistry is a centralized registry that manages all health contributors (indicators and aggregators).
When a health check is triggered, the HealthEndpoint retrieves all registered contributors from the HealthContributorRegistry and evaluates their status.
Custom health indicators are implemented by creating a class that implements the HealthIndicator interface. These are automatically registered through Spring Boot when annotated with @Component or defined as a @Bean.
The /actuator/health endpoint aggregates information from all registered HealthIndicator beans and displays their statuses. Developers can control which indicators are included or excluded.
HTTP status codes returned by the health endpoint can be mapped to specific health statuses. Sensitive details in health responses can be selectively included or excluded.
Overall, Spring Boot Actuator’s health indicators provide default and custom functionality to monitor specific components and resources, and can be customized to meet specific requirements.
The framework’s architecture provides a structured yet adaptable way to monitor applications using predefined capabilities with developer-defined logic.