[aerogear-dev] Status code for /health endpoint ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[aerogear-dev] Status code for /health endpoint ?

Matthias Wessendorf
Hi,

we have a /health endpoint:

that gives indication if the DB and the supported push-networks are reachable.

If all goes well, it returns '200' and a response like:
{"status":"ok","details":[{"description":"Database connection","result":"connected","runtime":191,"test_status":"ok"},{"description":"Google Cloud Messaging","result":"online","runtime":143,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":260,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":263,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":351,"test_status":"ok"}],"summary":"Everything is ok"}



If something, like DB, is not reachable, it also returns '200', and describes the problems in the JSON response:
{"status":"crit","details":[{"description":"Database connection","result":"org.hibernate.exception.JDBCConnectionException: could not extract ResultSet","runtime":26,"test_status":"crit"},{"description":"Google Cloud Messaging","result":"online","runtime":14,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":32,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":211,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":149,"test_status":"ok"}],"summary":"There is 1 error found"}


Questions:
* do we continue to return '200' in the later case?
* Or should we give a 500 if there is at least one problem ? 

Please report your desire :-)


-Matthias

--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Status code for /health endpoint ?

Ron Smeral
Hi,

the health endpoint is an HTTP server.
Regardless of what information the endpoint provides, HTTP status codes should reflect the state of the server itself.
A 500 error would mean that the health endpoint itself is unhealthy.

My 2c.

Ron

On 7.7.2016 13:26, Matthias Wessendorf wrote:
Hi,

we have a /health endpoint:

that gives indication if the DB and the supported push-networks are reachable.

If all goes well, it returns '200' and a response like:
{"status":"ok","details":[{"description":"Database connection","result":"connected","runtime":191,"test_status":"ok"},{"description":"Google Cloud Messaging","result":"online","runtime":143,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":260,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":263,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":351,"test_status":"ok"}],"summary":"Everything is ok"}



If something, like DB, is not reachable, it also returns '200', and describes the problems in the JSON response:
{"status":"crit","details":[{"description":"Database connection","result":"org.hibernate.exception.JDBCConnectionException: could not extract ResultSet","runtime":26,"test_status":"crit"},{"description":"Google Cloud Messaging","result":"online","runtime":14,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":32,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":211,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":149,"test_status":"ok"}],"summary":"There is 1 error found"}


Questions:
* do we continue to return '200' in the later case?
* Or should we give a 500 if there is at least one problem ? 

Please report your desire :-)


-Matthias

--


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

-- 
Ron Smeral
Technical Writer, RHMAP
Brno

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Status code for /health endpoint ?

Summers Pittman
In reply to this post by Matthias Wessendorf


On Thu, Jul 7, 2016 at 7:26 AM, Matthias Wessendorf <[hidden email]> wrote:
Hi,

we have a /health endpoint:

that gives indication if the DB and the supported push-networks are reachable.

If all goes well, it returns '200' and a response like:
{"status":"ok","details":[{"description":"Database connection","result":"connected","runtime":191,"test_status":"ok"},{"description":"Google Cloud Messaging","result":"online","runtime":143,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":260,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":263,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":351,"test_status":"ok"}],"summary":"Everything is ok"}



If something, like DB, is not reachable, it also returns '200', and describes the problems in the JSON response:
{"status":"crit","details":[{"description":"Database connection","result":"org.hibernate.exception.JDBCConnectionException: could not extract ResultSet","runtime":26,"test_status":"crit"},{"description":"Google Cloud Messaging","result":"online","runtime":14,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":32,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":211,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":149,"test_status":"ok"}],"summary":"There is 1 error found"}


Questions:
* do we continue to return '200' in the later case?
Yes 
* Or should we give a 500 if there is at least one problem ? 
No, unless the server is unable to fufll the health request.  

Please report your desire :-)


 


-Matthias

--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Status code for /health endpoint ?

Luke Holmquist


On Thu, Jul 7, 2016 at 8:56 AM, Summers Pittman <[hidden email]> wrote:


On Thu, Jul 7, 2016 at 7:26 AM, Matthias Wessendorf <[hidden email]> wrote:
Hi,

we have a /health endpoint:

that gives indication if the DB and the supported push-networks are reachable.

If all goes well, it returns '200' and a response like:
{"status":"ok","details":[{"description":"Database connection","result":"connected","runtime":191,"test_status":"ok"},{"description":"Google Cloud Messaging","result":"online","runtime":143,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":260,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":263,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":351,"test_status":"ok"}],"summary":"Everything is ok"}



If something, like DB, is not reachable, it also returns '200', and describes the problems in the JSON response:
{"status":"crit","details":[{"description":"Database connection","result":"org.hibernate.exception.JDBCConnectionException: could not extract ResultSet","runtime":26,"test_status":"crit"},{"description":"Google Cloud Messaging","result":"online","runtime":14,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":32,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":211,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":149,"test_status":"ok"}],"summary":"There is 1 error found"}


Questions:
* do we continue to return '200' in the later case?
Yes 
* Or should we give a 500 if there is at least one problem ? 
No, unless the server is unable to fufll the health request.  

+1 to this option.

Please report your desire :-)


 


-Matthias

--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Status code for /health endpoint ?

Matthias Wessendorf


On Thu, Jul 7, 2016 at 3:00 PM, Luke Holmquist <[hidden email]> wrote:


On Thu, Jul 7, 2016 at 8:56 AM, Summers Pittman <[hidden email]> wrote:


On Thu, Jul 7, 2016 at 7:26 AM, Matthias Wessendorf <[hidden email]> wrote:
Hi,

we have a /health endpoint:

that gives indication if the DB and the supported push-networks are reachable.

If all goes well, it returns '200' and a response like:
{"status":"ok","details":[{"description":"Database connection","result":"connected","runtime":191,"test_status":"ok"},{"description":"Google Cloud Messaging","result":"online","runtime":143,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":260,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":263,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":351,"test_status":"ok"}],"summary":"Everything is ok"}



If something, like DB, is not reachable, it also returns '200', and describes the problems in the JSON response:
{"status":"crit","details":[{"description":"Database connection","result":"org.hibernate.exception.JDBCConnectionException: could not extract ResultSet","runtime":26,"test_status":"crit"},{"description":"Google Cloud Messaging","result":"online","runtime":14,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":32,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":211,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":149,"test_status":"ok"}],"summary":"There is 1 error found"}


Questions:
* do we continue to return '200' in the later case?
Yes 
* Or should we give a 500 if there is at least one problem ? 
No, unless the server is unable to fufll the health request.  

+1 to this option.

ok, so we stay as is today - yay!
 

Please report your desire :-)


 


-Matthias

--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev