Appropriate use of HTTP status codes for application health checks

Hello,



My colleagues and I are involved in a debate about the proper usage of HTTP return codes for application health pages.



For instance, you have a /health page that returns JSON listing your application’s dependencies as either “Up” or “Down”



Some suggest that it is acceptable for your /health page to return an unassigned 5xx or 503 if the /health page returns successfully, but the page results indicate the application is not healthy. Spring Boot <https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.1-Release-Notes#healthindicators> has done this. Although I have reservations about 503 since your request for the page was handled successfully.



Other contend that your /health page should always return a 200 regardless of whether the page results is indicative of application health or not. 



As a layman I can see the argument for both sides, and it seems both practices have been used in the past. I perused the RFCs but I don’t feel like I found the ‘silver bullet’ answer on this.



Kindly,

Matt

Received on Thursday, 23 February 2017 08:03:56 UTC