Appropriate use of HTTP status codes for application health checks

matt <drbearded@gmail.com> Thu, 23 February 2017 08:07 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A734A12A12E for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 23 Feb 2017 00:07:42 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.899
X-Spam-Level:
X-Spam-Status: No, score=-6.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oB52V1-zCw5L for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 23 Feb 2017 00:07:41 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3EFB412A12D for <httpbisa-archive-bis2Juki@lists.ietf.org>; Thu, 23 Feb 2017 00:07:40 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cgoNg-0000JE-Ud for ietf-http-wg-dist@listhub.w3.org; Thu, 23 Feb 2017 08:04:04 +0000
Resent-Message-Id: <E1cgoNg-0000JE-Ud@frink.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <ylafon@w3.org>) id 1cgoNY-0000Hu-Bp for ietf-http-wg@listhub.w3.org; Thu, 23 Feb 2017 08:03:56 +0000
Received: from raoul.w3.org ([128.30.52.128]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <ylafon@w3.org>) id 1cgoNR-0004bv-GA for ietf-http-wg@w3.org; Thu, 23 Feb 2017 08:03:50 +0000
Received: from platy.fdn.fr ([80.67.176.7] helo=[192.168.1.36]) by raoul.w3.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <ylafon@w3.org>) id 1cgoNR-0002WN-4C for ietf-http-wg@w3.org; Thu, 23 Feb 2017 08:03:49 +0000
Content-Type: multipart/alternative; boundary="Apple-Mail=_E4E03A8D-F616-4AD3-B190-D38CAA2600A2"
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
From: matt <drbearded@gmail.com>
Resent-From: Yves Lafon <ylafon@w3.org>
Date: Thu, 23 Feb 2017 00:54:11 +0000
Resent-Date: Thu, 23 Feb 2017 09:03:47 +0100
Resent-To: ietf-http-wg@w3.org
Message-Id: <CADfyV-Pa0fu2SDwLYzMrUe4D0Tv0wu27pmHpLjCxQXR3ev4mmA@mail.gmail.com>
X-Name-Md5: efe3dad792d606410c9cc49cedaffc94
To: ietf-http-wg@w3.org
X-Mailer: Apple Mail (2.3259)
X-W3C-Hub-Spam-Status: No, score=-1.5
X-W3C-Hub-Spam-Report: ALL_TRUSTED=-1, BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, NML_ADSP_CUSTOM_MED=0.9, RP_MATCHES_RCVD=-0.001, URIBL_BLOCKED=0.001, W3C_NW=0.5
X-W3C-Scan-Sig: titan.w3.org 1cgoNR-0004bv-GA 6e1c4fcbbc7a4b3f30bd4fe7678fe9dd
X-Original-To: ietf-http-wg@w3.org
Subject: Appropriate use of HTTP status codes for application health checks
Archived-At: <http://www.w3.org/mid/CADfyV-Pa0fu2SDwLYzMrUe4D0Tv0wu27pmHpLjCxQXR3ev4mmA@mail.gmail.com>
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33591
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

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