{"action":"created","issue":{"url":"https://api.github.com/repos/vernemq/vernemq/issues/912","repository_url":"https://api.github.com/repos/vernemq/vernemq","labels_url":"https://api.github.com/repos/vernemq/vernemq/issues/912/labels{/name}","comments_url":"https://api.github.com/repos/vernemq/vernemq/issues/912/comments","events_url":"https://api.github.com/repos/vernemq/vernemq/issues/912/events","html_url":"https://github.com/vernemq/vernemq/pull/912","id":374143989,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1OTEyOTU1","number":912,"title":"Add HTTP healthcheck endpoint","user":{"login":"codeadict","id":168440,"node_id":"MDQ6VXNlcjE2ODQ0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/168440?v=4","gravatar_id":"","url":"https://api.github.com/users/codeadict","html_url":"https://github.com/codeadict","followers_url":"https://api.github.com/users/codeadict/followers","following_url":"https://api.github.com/users/codeadict/following{/other_user}","gists_url":"https://api.github.com/users/codeadict/gists{/gist_id}","starred_url":"https://api.github.com/users/codeadict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeadict/subscriptions","organizations_url":"https://api.github.com/users/codeadict/orgs","repos_url":"https://api.github.com/users/codeadict/repos","events_url":"https://api.github.com/users/codeadict/events{/privacy}","received_events_url":"https://api.github.com/users/codeadict/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-10-25T21:40:39Z","updated_at":"2018-11-05T21:03:39Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/vernemq/vernemq/pulls/912","html_url":"https://github.com/vernemq/vernemq/pull/912","diff_url":"https://github.com/vernemq/vernemq/pull/912.diff","patch_url":"https://github.com/vernemq/vernemq/pull/912.patch"},"body":"Added a `/health` endpoint to the default **http_modules** setting.\r\nThis endpoint will allow for better deployments on load-balanced\r\nenvironments and VerneMQ will need to meet the following conditions:\r\n\r\n1. Ensure that all the configured listeners are un running status.\r\n2. Node has joined the cluster and is running.\r\n\r\nIn case they are both met, the endpoint returns:\r\n\r\n```http\r\nGET {{SERVER}}/health HTTP/1.1\r\nContent-Type: application/json\r\nStatus-Code: 200\r\n{\r\n  \"status\": \"OK\"\r\n}\r\n```\r\n\r\nIn case the conditions are not met. it can return:\r\n\r\n```http\r\nGET {{SERVER}}/health HTTP/1.1\r\nContent-Type: application/json\r\nStatus-Code: 503\r\n{\r\n  \"status\": \"DOWN\",\r\n  \"reason\": \"Node has not joined the cluster\"\r\n}\r\n```\r\n\r\nor:\r\n\r\n```http\r\nGET {{SERVER}}/health HTTP/1.1\r\nContent-Type: application/json\r\nStatus-Code: 503\r\n{\r\n  \"status\": \"DOWN\",\r\n  \"reason\": \"Listeners are not ready: mqtt\"\r\n}\r\n```\r\n\r\nStill a **WIP**, need to add more lager debugs and tests, @dergraf @larshesel feel free to review and recommend something earlier."},"comment":{"url":"https://api.github.com/repos/vernemq/vernemq/issues/comments/436033895","html_url":"https://github.com/vernemq/vernemq/pull/912#issuecomment-436033895","issue_url":"https://api.github.com/repos/vernemq/vernemq/issues/912","id":436033895,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjAzMzg5NQ==","user":{"login":"codeadict","id":168440,"node_id":"MDQ6VXNlcjE2ODQ0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/168440?v=4","gravatar_id":"","url":"https://api.github.com/users/codeadict","html_url":"https://github.com/codeadict","followers_url":"https://api.github.com/users/codeadict/followers","following_url":"https://api.github.com/users/codeadict/following{/other_user}","gists_url":"https://api.github.com/users/codeadict/gists{/gist_id}","starred_url":"https://api.github.com/users/codeadict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeadict/subscriptions","organizations_url":"https://api.github.com/users/codeadict/orgs","repos_url":"https://api.github.com/users/codeadict/repos","events_url":"https://api.github.com/users/codeadict/events{/privacy}","received_events_url":"https://api.github.com/users/codeadict/received_events","type":"User","site_admin":false},"created_at":"2018-11-05T21:03:39Z","updated_at":"2018-11-05T21:03:39Z","author_association":"CONTRIBUTOR","body":"Any objection to introducing meck? Some test coverage is hard to get without mocking some function calls, I think it could be of benefit."}}
{"actor":{"display_login":"codeadict"}}