-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
add a health endpoint #448
Conversation
Signed-off-by: Andreas Bräu <ab@andi95.de>
@digitaldan can you please have a look on that? |
Hi, LGTM, i'm working in the code this week, so will give this a quick test today or tomorrow. Thanks! |
HI one comment, can you add a config option to enable/disable this? I don't want to have this exposed on our public service, and would prefer not to try and block this specific route in our load balancer (its already complicated). Thanks ! |
Signed-off-by: Andreas Bräu <ab@andi95.de>
Sure, I added a config option. Usually things like that I would only expose to another endpoint, that is not public. |
@digitaldan can you please take a look again? |
@@ -6,7 +6,10 @@ | |||
"logger" : { | |||
"type": "console" | |||
}, | |||
"subDomainCookies": false | |||
"subDomainCookies": false, | |||
"healthEndpoint" : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why this can't be a single value, like "healthEndpointEnabled" : true
? Are you thinking there would be more options available in the future for the health endpoint that would warrent its own section/object ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, for example we could add another option to configure not to return error details, but just the health status.
Or configure, as I said in the other answer to check for other modules/dependencies.
Hi, sorry i missed your changes in my sea of github notifications. Just left a few questions. |
LGTM, thanks. |
I use openhab cloud in a kubernetes environment. When the mongodb connection gets lost, it doesn't recover alone.
Kubernetes doesn't see that the state isn't healthy by just probing the home page. So I created a health endpoint that returns HTTP status 200 in case every is ok, else it returns HTTP status 500.