{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/consul/pulls/comments/211765819","pull_request_review_id":148254626,"id":211765819,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTc2NTgxOQ==","diff_hunk":"@@ -58,6 +58,66 @@ $ curl \\\n }\n ```\n \n+## Get local service health\n+\n+The `/v1/agent/health/service/name/<service_name>` and\n+`/v1/agent/health/service/id/<service_id>` endpoints allow to retrieve an\n+aggregated state of service(s) of the local agent.\n+\n+The endpoint `/v1/agent/health/service/name/<service_name>` query all\n+services with a given names (several may match), while\n+`/v1/agent/health/service/id/<service_id>` will match a single service only.\n+\n+If you know the ID of service you want to target, it is recommended to use\n+the version `/v1/agent/health/service/id/<service_id>` so you have the result\n+for the service only. When requesting\n+`/v1/agent/health/service/name/<service_name>`, the caller will receive the\n+worst state of all services having the given name.\n+\n+Those endpoints return the aggregated values of all healthchecks for the\n+service and will return the corresponding HTTP codes:\n+\n+| Result | Meaning                                                |\n+| ------ | ------------------------------------------------------ |\n+| `200`  | All healthchecks of this service are passing           |\n+| `400`  | Bad parameter (missing service name of id)             |\n+| `404`  | No such service id or name                             |\n+| `429`  | Some healthchecks are passing, at least one is warning |\n+| `503`  | All healthchecks of this service are passing           |","path":"website/source/api/agent/service.html.md","position":29,"original_position":29,"commit_id":"0b0ea48825ed9cfc625fa5ec3a35e1b61ac1160d","original_commit_id":"0b0ea48825ed9cfc625fa5ec3a35e1b61ac1160d","user":{"login":"pierresouchay","id":8089033,"node_id":"MDQ6VXNlcjgwODkwMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/8089033?v=4","gravatar_id":"","url":"https://api.github.com/users/pierresouchay","html_url":"https://github.com/pierresouchay","followers_url":"https://api.github.com/users/pierresouchay/followers","following_url":"https://api.github.com/users/pierresouchay/following{/other_user}","gists_url":"https://api.github.com/users/pierresouchay/gists{/gist_id}","starred_url":"https://api.github.com/users/pierresouchay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierresouchay/subscriptions","organizations_url":"https://api.github.com/users/pierresouchay/orgs","repos_url":"https://api.github.com/users/pierresouchay/repos","events_url":"https://api.github.com/users/pierresouchay/events{/privacy}","received_events_url":"https://api.github.com/users/pierresouchay/received_events","type":"User","site_admin":false},"body":"@mkeeler Well spotted, fixed","created_at":"2018-08-21T21:27:01Z","updated_at":"2018-08-21T21:31:37Z","html_url":"https://github.com/hashicorp/consul/pull/3551#discussion_r211765819","pull_request_url":"https://api.github.com/repos/hashicorp/consul/pulls/3551","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/comments/211765819"},"html":{"href":"https://github.com/hashicorp/consul/pull/3551#discussion_r211765819"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/3551"}},"in_reply_to_id":211713883},"pull_request":{"url":"https://api.github.com/repos/hashicorp/consul/pulls/3551","id":145298096,"node_id":"MDExOlB1bGxSZXF1ZXN0MTQ1Mjk4MDk2","html_url":"https://github.com/hashicorp/consul/pull/3551","diff_url":"https://github.com/hashicorp/consul/pull/3551.diff","patch_url":"https://github.com/hashicorp/consul/pull/3551.patch","issue_url":"https://api.github.com/repos/hashicorp/consul/issues/3551","number":3551,"state":"open","locked":false,"title":"Implement /v1/agent/health/service/<service name> endpoint","user":{"login":"kamaradclimber","id":503537,"node_id":"MDQ6VXNlcjUwMzUzNw==","avatar_url":"https://avatars1.githubusercontent.com/u/503537?v=4","gravatar_id":"","url":"https://api.github.com/users/kamaradclimber","html_url":"https://github.com/kamaradclimber","followers_url":"https://api.github.com/users/kamaradclimber/followers","following_url":"https://api.github.com/users/kamaradclimber/following{/other_user}","gists_url":"https://api.github.com/users/kamaradclimber/gists{/gist_id}","starred_url":"https://api.github.com/users/kamaradclimber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamaradclimber/subscriptions","organizations_url":"https://api.github.com/users/kamaradclimber/orgs","repos_url":"https://api.github.com/users/kamaradclimber/repos","events_url":"https://api.github.com/users/kamaradclimber/events{/privacy}","received_events_url":"https://api.github.com/users/kamaradclimber/received_events","type":"User","site_admin":false},"body":"This endpoint aggregate all checks related to <service id> on the agent\r\nand return an appropriate http code + the string describing the worst\r\ncheck.\r\n\r\nThis allows to cleanly expose service status to other component, hiding\r\ncomplexity of multiple checks.\r\nThis is especially useful to use consul to feed a loadbalancer which\r\nwould deleguate healthchecking to consul agent.\r\n\r\nExposing this endpoint on the agent is necessary to avoid a hit on\r\nconsul servers and avoid decreasing resiliency (this endpoint will work\r\neven if there is no consul leader in the cluster).\r\n\r\nFix #2488, relates to #802\r\n\r\nChange-Id: Ib340c62bbbba46fd4256ed31474d8ffb1762d4df\r\nSigned-off-by: Grégoire Seux <g.seux@criteo.com>","created_at":"2017-10-07T16:21:49Z","updated_at":"2018-08-21T21:31:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4dd29c4a998abd4b20e8760ed568776764dad87b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/consul/pulls/3551/commits","review_comments_url":"https://api.github.com/repos/hashicorp/consul/pulls/3551/comments","review_comment_url":"https://api.github.com/repos/hashicorp/consul/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/consul/issues/3551/comments","statuses_url":"https://api.github.com/repos/hashicorp/consul/statuses/0b0ea48825ed9cfc625fa5ec3a35e1b61ac1160d","head":{"label":"criteo-forks:agent_health_service","ref":"agent_health_service","sha":"0b0ea48825ed9cfc625fa5ec3a35e1b61ac1160d","user":{"login":"criteo-forks","id":9960514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NjA1MTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/9960514?v=4","gravatar_id":"","url":"https://api.github.com/users/criteo-forks","html_url":"https://github.com/criteo-forks","followers_url":"https://api.github.com/users/criteo-forks/followers","following_url":"https://api.github.com/users/criteo-forks/following{/other_user}","gists_url":"https://api.github.com/users/criteo-forks/gists{/gist_id}","starred_url":"https://api.github.com/users/criteo-forks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/criteo-forks/subscriptions","organizations_url":"https://api.github.com/users/criteo-forks/orgs","repos_url":"https://api.github.com/users/criteo-forks/repos","events_url":"https://api.github.com/users/criteo-forks/events{/privacy}","received_events_url":"https://api.github.com/users/criteo-forks/received_events","type":"Organization","site_admin":false},"repo":{"id":72870985,"node_id":"MDEwOlJlcG9zaXRvcnk3Mjg3MDk4NQ==","name":"consul","full_name":"criteo-forks/consul","owner":{"login":"criteo-forks","id":9960514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NjA1MTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/9960514?v=4","gravatar_id":"","url":"https://api.github.com/users/criteo-forks","html_url":"https://github.com/criteo-forks","followers_url":"https://api.github.com/users/criteo-forks/followers","following_url":"https://api.github.com/users/criteo-forks/following{/other_user}","gists_url":"https://api.github.com/users/criteo-forks/gists{/gist_id}","starred_url":"https://api.github.com/users/criteo-forks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/criteo-forks/subscriptions","organizations_url":"https://api.github.com/users/criteo-forks/orgs","repos_url":"https://api.github.com/users/criteo-forks/repos","events_url":"https://api.github.com/users/criteo-forks/events{/privacy}","received_events_url":"https://api.github.com/users/criteo-forks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/criteo-forks/consul","description":"Consul is a tool for service discovery, monitoring and configuration.","fork":true,"url":"https://api.github.com/repos/criteo-forks/consul","forks_url":"https://api.github.com/repos/criteo-forks/consul/forks","keys_url":"https://api.github.com/repos/criteo-forks/consul/keys{/key_id}","collaborators_url":"https://api.github.com/repos/criteo-forks/consul/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/criteo-forks/consul/teams","hooks_url":"https://api.github.com/repos/criteo-forks/consul/hooks","issue_events_url":"https://api.github.com/repos/criteo-forks/consul/issues/events{/number}","events_url":"https://api.github.com/repos/criteo-forks/consul/events","assignees_url":"https://api.github.com/repos/criteo-forks/consul/assignees{/user}","branches_url":"https://api.github.com/repos/criteo-forks/consul/branches{/branch}","tags_url":"https://api.github.com/repos/criteo-forks/consul/tags","blobs_url":"https://api.github.com/repos/criteo-forks/consul/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/criteo-forks/consul/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/criteo-forks/consul/git/refs{/sha}","trees_url":"https://api.github.com/repos/criteo-forks/consul/git/trees{/sha}","statuses_url":"https://api.github.com/repos/criteo-forks/consul/statuses/{sha}","languages_url":"https://api.github.com/repos/criteo-forks/consul/languages","stargazers_url":"https://api.github.com/repos/criteo-forks/consul/stargazers","contributors_url":"https://api.github.com/repos/criteo-forks/consul/contributors","subscribers_url":"https://api.github.com/repos/criteo-forks/consul/subscribers","subscription_url":"https://api.github.com/repos/criteo-forks/consul/subscription","commits_url":"https://api.github.com/repos/criteo-forks/consul/commits{/sha}","git_commits_url":"https://api.github.com/repos/criteo-forks/consul/git/commits{/sha}","comments_url":"https://api.github.com/repos/criteo-forks/consul/comments{/number}","issue_comment_url":"https://api.github.com/repos/criteo-forks/consul/issues/comments{/number}","contents_url":"https://api.github.com/repos/criteo-forks/consul/contents/{+path}","compare_url":"https://api.github.com/repos/criteo-forks/consul/compare/{base}...{head}","merges_url":"https://api.github.com/repos/criteo-forks/consul/merges","archive_url":"https://api.github.com/repos/criteo-forks/consul/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/criteo-forks/consul/downloads","issues_url":"https://api.github.com/repos/criteo-forks/consul/issues{/number}","pulls_url":"https://api.github.com/repos/criteo-forks/consul/pulls{/number}","milestones_url":"https://api.github.com/repos/criteo-forks/consul/milestones{/number}","notifications_url":"https://api.github.com/repos/criteo-forks/consul/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/criteo-forks/consul/labels{/name}","releases_url":"https://api.github.com/repos/criteo-forks/consul/releases{/id}","deployments_url":"https://api.github.com/repos/criteo-forks/consul/deployments","created_at":"2016-11-04T17:37:47Z","updated_at":"2017-01-13T17:32:06Z","pushed_at":"2018-08-21T08:56:11Z","git_url":"git://github.com/criteo-forks/consul.git","ssh_url":"git@github.com:criteo-forks/consul.git","clone_url":"https://github.com/criteo-forks/consul.git","svn_url":"https://github.com/criteo-forks/consul","homepage":"https://www.consul.io/","size":59613,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"559d35156af75448a9023c3152b7293890e2cc06","user":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":14125254,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEyNTI1NA==","name":"consul","full_name":"hashicorp/consul","owner":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/consul","description":"Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.","fork":false,"url":"https://api.github.com/repos/hashicorp/consul","forks_url":"https://api.github.com/repos/hashicorp/consul/forks","keys_url":"https://api.github.com/repos/hashicorp/consul/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/consul/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/consul/teams","hooks_url":"https://api.github.com/repos/hashicorp/consul/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/consul/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/consul/events","assignees_url":"https://api.github.com/repos/hashicorp/consul/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/consul/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/consul/tags","blobs_url":"https://api.github.com/repos/hashicorp/consul/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/consul/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/consul/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/consul/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/consul/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/consul/languages","stargazers_url":"https://api.github.com/repos/hashicorp/consul/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/consul/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/consul/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/consul/subscription","commits_url":"https://api.github.com/repos/hashicorp/consul/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/consul/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/consul/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/consul/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/consul/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/consul/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/consul/merges","archive_url":"https://api.github.com/repos/hashicorp/consul/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/consul/downloads","issues_url":"https://api.github.com/repos/hashicorp/consul/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/consul/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/consul/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/consul/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/consul/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/consul/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/consul/deployments","created_at":"2013-11-04T22:15:27Z","updated_at":"2018-08-21T21:24:34Z","pushed_at":"2018-08-21T15:43:21Z","git_url":"git://github.com/hashicorp/consul.git","ssh_url":"git@github.com:hashicorp/consul.git","clone_url":"https://github.com/hashicorp/consul.git","svn_url":"https://github.com/hashicorp/consul","homepage":"https://www.consul.io/","size":60659,"stargazers_count":13206,"watchers_count":13206,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2317,"mirror_url":null,"archived":false,"open_issues_count":447,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":2317,"open_issues":447,"watchers":13206,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/3551"},"html":{"href":"https://github.com/hashicorp/consul/pull/3551"},"issue":{"href":"https://api.github.com/repos/hashicorp/consul/issues/3551"},"comments":{"href":"https://api.github.com/repos/hashicorp/consul/issues/3551/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/3551/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/3551/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/consul/statuses/0b0ea48825ed9cfc625fa5ec3a35e1b61ac1160d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pierresouchay"}}