liip / LiipMonitorBundle

Integrates the LiipMonitor library into Symfony
http://liip.ch
467 stars 103 forks source link

Changing the HTTP status code when checks fail? #213

Closed tobz closed 5 years ago

tobz commented 5 years ago

Hey y'all!

I was wondering if you would be amendable to a PR that provides configurability of the "failure" HTTP status code returned when health checks are not all passing.

502 is very specifically "Bad Gateway", and isn't consistent with the service itself being unavailable/not ready to serve traffic. This only serves to cause confusion about whether or not a service is being proxied, and if that proxy is working or not, etc.

Given that changing the value itself would be a breaking change for existing usages, the idea of making it configurable came to mind.

Thoughts? :)

kbond commented 5 years ago

As long as it is configurable and the default 502, I think this would be ok.

The status code would need to be passed the controller via constructor arg. I think it's possible someone could have extended the controller in a way that could cause a bc break but I think the risk is minimal... WDYT @lsmith77?

lsmith77 commented 5 years ago

sounds good to me

tobz commented 5 years ago

Great! I'll work on a PR. Appreciate the gut check. 👍