Skip to content

Conditional Execution of Health Checks #3441

@coreyjv

Description

@coreyjv

I've been using the Spring Boot Actuator health check functionality for a while now and really enjoy the easy of writing custom HealthIndicators. However, there is one need that Spring Boot Actuator does not currently support (see this Stack Overflow thread for reference here) that I'd like to suggest as a new feature but first I'd like to explain our challenge.

For our applications the /health endpoint is queried very frequently (say every 5 seconds) to determine if fail over to another site needs to occur. For frequently executed queries the /heath endpoint should report the health of the application, and not execute any HealthIndicators that check the health of external dependencies such as external web services because those calls are expensive.

Additionally, there are times where health checks against external dependencies are needed during post deployment or troubleshooting scenarios. It's very easy to write custom HealthIndicators and having the ability to consolidate it all under one /health endpoint is advantageous instead of writing additional code to expose this through another endpoint.

If this feature request is accepted I'd like to propose that the implementation is opt-in so by default custom HealthIndicators are executed like they are today so users don't find themselves in a situation where a HealthIndicator is not run when they expect it to be.

Finally, if possible, I'd be willing to make the contributions to implement this feature as well.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions