{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3441","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3441/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3441/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3441/events","html_url":"https://github.com/spring-projects/spring-boot/issues/3441","id":93778388,"number":3441,"title":"Conditional Execution of Health Checks","user":{"login":"coreyjv","id":2730750,"avatar_url":"https://avatars.githubusercontent.com/u/2730750?v=3","gravatar_id":"","url":"https://api.github.com/users/coreyjv","html_url":"https://github.com/coreyjv","followers_url":"https://api.github.com/users/coreyjv/followers","following_url":"https://api.github.com/users/coreyjv/following{/other_user}","gists_url":"https://api.github.com/users/coreyjv/gists{/gist_id}","starred_url":"https://api.github.com/users/coreyjv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreyjv/subscriptions","organizations_url":"https://api.github.com/users/coreyjv/orgs","repos_url":"https://api.github.com/users/coreyjv/repos","events_url":"https://api.github.com/users/coreyjv/events{/privacy}","received_events_url":"https://api.github.com/users/coreyjv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-08T12:37:42Z","updated_at":"2015-07-08T12:47:11Z","closed_at":null,"body":"I've been using the Spring Boot Actuator health check functionality for a while now and really enjoy the easy of writing custom `HealthIndicator`s. However, there is one need that Spring Boot Actuator does not currently support (see this Stack Overflow thread for reference [here](http://stackoverflow.com/questions/31267619/distinguish-between-expensive-and-inexpensive-health-checks)) that I'd like to suggest as a new feature but first I'd like to explain our challenge.\r\n\r\nFor 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 `HealthIndicator`s that check the health of external dependencies such as external web services because those calls are expensive. \r\n\r\nAdditionally, 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.\r\n\r\nIf this feature request is accepted I'd like to propose that the implementation is *opt-in* so by default custom  `HealthIndicator`s 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.\r\n\r\nFinally, if possible, I'd be willing to make the contributions to implement this feature as well.\r\n\r\nThank you!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/119566789","html_url":"https://github.com/spring-projects/spring-boot/issues/3441#issuecomment-119566789","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3441","id":119566789,"user":{"login":"snicoll","id":490484,"avatar_url":"https://avatars.githubusercontent.com/u/490484?v=3","gravatar_id":"","url":"https://api.github.com/users/snicoll","html_url":"https://github.com/snicoll","followers_url":"https://api.github.com/users/snicoll/followers","following_url":"https://api.github.com/users/snicoll/following{/other_user}","gists_url":"https://api.github.com/users/snicoll/gists{/gist_id}","starred_url":"https://api.github.com/users/snicoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snicoll/subscriptions","organizations_url":"https://api.github.com/users/snicoll/orgs","repos_url":"https://api.github.com/users/snicoll/repos","events_url":"https://api.github.com/users/snicoll/events{/privacy}","received_events_url":"https://api.github.com/users/snicoll/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T12:47:11Z","updated_at":"2015-07-08T12:47:11Z","body":"Are you aware that there is a `endpoints.health.time-to-live`that caches the result of the health check. Would that help?"}}