-
Notifications
You must be signed in to change notification settings - Fork 265
feat: add JSON body to /health and /ready endpoints #1032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @boxcee , thank you for submitting a PR. I can't help but ask, what is the point of |
Yeah, fair question.
|
What is the framework? I think it is very weird for a framework to not allow getting a status code out of a HTTP response.
This PR adds no such additional information to a health-check nor a readiness probe anyway. I believe the purpose of having If you need any custom probes/metrics/etc, you might want to add them (guarded by a feature flag) and expose via metric reporting to some kind of monitoring. But TBH I can't think of what those might be beyond existing reported metrics. |
|
I think it might be nice to have more information for these endpoints. I can see splitting health into several segments like Similarly, we could do something like that for However, all of this is a lot of work for not much benefit at the moment and we are unlikely to devote time to this currently. As @sergey-melnychuk mentions, having a framework not operate on the HTTP codes at all.. is weird. Which framework is it? And can you elaborate on how you use it? |
|
Perhaps the use of framework here is a bit misleading. I am using a home automation setup for a lot of things at home. Now I am running a pathfinder node in my local network and would like to monitor its health via the automation setup. They have a multitude of integrations for all kinds of sensors, none for this use-case though. So I am using the RESTful Binary Sensor integration. Unfortunately that one expects some JSON response to determine the state of the sensor (on = healthy, off = unhealthy). I see it is a lot of work to actually implement the additional reporting for health and ready checks. |
Definitely not what I expected 😁
Yeah I see. I tried looking through the home automation issues, but I don't see anything related to http status codes so you are probably correct. Some options:
I would also open an issue with home-assistant to add support for HTTP codes. Really funny to me that they support arbitrary json strings, but not the literal codes. |
Would using a |
Hm, what can I say... Thank you! That did the trick. |
I would like to add some bodies to the
/healthand/readyendpoints, please.