Non 200 response when a service is down? #999
-
While Gatus serves the purpose of Status pages brilliantly, I have not been able to use it as a simple monitoring service. Basically the end point curl http://gatusip:port/api/v1/endpoints/key/statuses/ always returns 200 and a JSON. For simple monitoring one really needs a non 200 response like 500 for e.g. to be able to use this and query the status. Any idea of enhancing the statuses endpoint or adding a new one that just signals if a service is UP or DOWN using HTTP return codes? This could be a simple config in endpoint to return a specific http code when the service is down. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I understand what you're suggesting, but I personally am not a big fan of this kind of approach; the API is expected to return 2xx if it works as intended, and it does work as intended even if some endpoints it monitors are unhealthy. If it returns 5xx, then I wouldn't consider that as meaning "the endpoints monitored by Gatus are failing", but instead, "Gatus is not working as intended". I'd suggest you look into jsonpath or even regex or normal string matching. All of those should allow you to check the body for unhealthy endpoints. |
Beta Was this translation helpful? Give feedback.
I understand what you're suggesting, but I personally am not a big fan of this kind of approach; the API is expected to return 2xx if it works as intended, and it does work as intended even if some endpoints it monitors are unhealthy. If it returns 5xx, then I wouldn't consider that as meaning "the endpoints monitored by Gatus are failing", but instead, "Gatus is not working as intended".
I'd suggest you look into jsonpath or even regex or normal string matching. All of those should allow you to check the body for unhealthy endpoints.