{"action":"created","comment":{"url":"https://api.github.com/repos/trivago/gollum/pulls/comments/113884321","pull_request_review_id":35308041,"id":113884321,"diff_hunk":"@@ -115,6 +116,15 @@ func main() {\n \t\tdefer server.Stop()\n \t}\n \n+\t// Health Check endpoint\n+\n+\tif true {\n+\t\t// TODO: package, config\n+\t\thealthcheck.Configure(\":8012\")","path":"main.go","position":16,"original_position":16,"commit_id":"fd2365766fb501ee151e225ac4b99979b1513f6d","original_commit_id":"fd2365766fb501ee151e225ac4b99979b1513f6d","user":{"login":"arnecls","id":6131989,"avatar_url":"https://avatars1.githubusercontent.com/u/6131989?v=3","gravatar_id":"","url":"https://api.github.com/users/arnecls","html_url":"https://github.com/arnecls","followers_url":"https://api.github.com/users/arnecls/followers","following_url":"https://api.github.com/users/arnecls/following{/other_user}","gists_url":"https://api.github.com/users/arnecls/gists{/gist_id}","starred_url":"https://api.github.com/users/arnecls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnecls/subscriptions","organizations_url":"https://api.github.com/users/arnecls/orgs","repos_url":"https://api.github.com/users/arnecls/repos","events_url":"https://api.github.com/users/arnecls/events{/privacy}","received_events_url":"https://api.github.com/users/arnecls/received_events","type":"User","site_admin":false},"body":"Should be defined by command line flags (see flags.go)","created_at":"2017-04-28T09:02:13Z","updated_at":"2017-04-28T09:04:33Z","html_url":"https://github.com/trivago/gollum/pull/105#discussion_r113884321","pull_request_url":"https://api.github.com/repos/trivago/gollum/pulls/105","_links":{"self":{"href":"https://api.github.com/repos/trivago/gollum/pulls/comments/113884321"},"html":{"href":"https://github.com/trivago/gollum/pull/105#discussion_r113884321"},"pull_request":{"href":"https://api.github.com/repos/trivago/gollum/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/trivago/gollum/pulls/105","id":118061740,"html_url":"https://github.com/trivago/gollum/pull/105","diff_url":"https://github.com/trivago/gollum/pull/105.diff","patch_url":"https://github.com/trivago/gollum/pull/105.patch","issue_url":"https://api.github.com/repos/trivago/gollum/issues/105","number":105,"state":"open","locked":false,"title":"Health check endpoint, with sample implementation for prod.HTTPRequest (#88)","user":{"login":"ppar","id":5546061,"avatar_url":"https://avatars0.githubusercontent.com/u/5546061?v=3","gravatar_id":"","url":"https://api.github.com/users/ppar","html_url":"https://github.com/ppar","followers_url":"https://api.github.com/users/ppar/followers","following_url":"https://api.github.com/users/ppar/following{/other_user}","gists_url":"https://api.github.com/users/ppar/gists{/gist_id}","starred_url":"https://api.github.com/users/ppar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppar/subscriptions","organizations_url":"https://api.github.com/users/ppar/orgs","repos_url":"https://api.github.com/users/ppar/repos","events_url":"https://api.github.com/users/ppar/events{/privacy}","received_events_url":"https://api.github.com/users/ppar/received_events","type":"User","site_admin":false},"body":"This PR implements an HTTP health check endpoint in Gollum where plugins can add their own health check hooks and adds a couple of simple health checks in the `producer.HTTPRequest` plugin.\r\n\r\nThe health checks offered look like this:\r\n\r\n```\r\n$ curl http://localhost:8012/\r\n/_ALL_\r\n/producer.HTTPRequest/HttpOut01/lastError\r\n/ping\r\n/producer.HTTPRequest/HttpOut01/SimpleProducer/pluginstate\r\n/producer.HTTPRequest/HttpOut01/pingBackend\r\n```\r\n\r\nHealth checks can be queried individually by path or all in sequence using `/_ALL`:\r\n\r\n```\r\n$ curl http://localhost:8012/_ALL_\r\n/ping 200 PONG\r\n/producer.HTTPRequest/HttpOut01/SimpleProducer/pluginstate 200 ACTIVE: Active\r\n/producer.HTTPRequest/HttpOut01/pingBackend 200 Done\r\n\r\n/producer.HTTPRequest/HttpOut01/lastError 200 OK\r\n```\r\n\r\nNotes:\r\n\r\n- The `healthcheck` package is independent from Gollum and could be moved to the `tgo` repository\r\n- Command line parameter for the port is still missing in main.go\r\n- Duplicate \"\\n\"s should be cleaned up\r\n- Health checks could be en-/disabled (and maybe fine-tuned) in plugin configuration\r\n- What constitutes a proper health check in each plugin is still an open question. Should we measure past errors, or actively probe the service we're talking to? Can we do the latter idempotently? E.g. reading from an S3 bucket or GETing a web service do not guarantee we can also write or POST to them, but the latter are rarely safe (or free) operations either. \r\n","created_at":"2017-04-28T01:03:36Z","updated_at":"2017-04-28T09:04:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af9de676b12dd46db052703fa69a0850cb5de513","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/trivago/gollum/pulls/105/commits","review_comments_url":"https://api.github.com/repos/trivago/gollum/pulls/105/comments","review_comment_url":"https://api.github.com/repos/trivago/gollum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trivago/gollum/issues/105/comments","statuses_url":"https://api.github.com/repos/trivago/gollum/statuses/fd2365766fb501ee151e225ac4b99979b1513f6d","head":{"label":"trivago:ghissue-88-healthcheck-enpoint-2","ref":"ghissue-88-healthcheck-enpoint-2","sha":"fd2365766fb501ee151e225ac4b99979b1513f6d","user":{"login":"trivago","id":1481788,"avatar_url":"https://avatars2.githubusercontent.com/u/1481788?v=3","gravatar_id":"","url":"https://api.github.com/users/trivago","html_url":"https://github.com/trivago","followers_url":"https://api.github.com/users/trivago/followers","following_url":"https://api.github.com/users/trivago/following{/other_user}","gists_url":"https://api.github.com/users/trivago/gists{/gist_id}","starred_url":"https://api.github.com/users/trivago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trivago/subscriptions","organizations_url":"https://api.github.com/users/trivago/orgs","repos_url":"https://api.github.com/users/trivago/repos","events_url":"https://api.github.com/users/trivago/events{/privacy}","received_events_url":"https://api.github.com/users/trivago/received_events","type":"Organization","site_admin":false},"repo":{"id":37787279,"name":"gollum","full_name":"trivago/gollum","owner":{"login":"trivago","id":1481788,"avatar_url":"https://avatars2.githubusercontent.com/u/1481788?v=3","gravatar_id":"","url":"https://api.github.com/users/trivago","html_url":"https://github.com/trivago","followers_url":"https://api.github.com/users/trivago/followers","following_url":"https://api.github.com/users/trivago/following{/other_user}","gists_url":"https://api.github.com/users/trivago/gists{/gist_id}","starred_url":"https://api.github.com/users/trivago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trivago/subscriptions","organizations_url":"https://api.github.com/users/trivago/orgs","repos_url":"https://api.github.com/users/trivago/repos","events_url":"https://api.github.com/users/trivago/events{/privacy}","received_events_url":"https://api.github.com/users/trivago/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trivago/gollum","description":"An n:m message multiplexer written in Go","fork":false,"url":"https://api.github.com/repos/trivago/gollum","forks_url":"https://api.github.com/repos/trivago/gollum/forks","keys_url":"https://api.github.com/repos/trivago/gollum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trivago/gollum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trivago/gollum/teams","hooks_url":"https://api.github.com/repos/trivago/gollum/hooks","issue_events_url":"https://api.github.com/repos/trivago/gollum/issues/events{/number}","events_url":"https://api.github.com/repos/trivago/gollum/events","assignees_url":"https://api.github.com/repos/trivago/gollum/assignees{/user}","branches_url":"https://api.github.com/repos/trivago/gollum/branches{/branch}","tags_url":"https://api.github.com/repos/trivago/gollum/tags","blobs_url":"https://api.github.com/repos/trivago/gollum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trivago/gollum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trivago/gollum/git/refs{/sha}","trees_url":"https://api.github.com/repos/trivago/gollum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trivago/gollum/statuses/{sha}","languages_url":"https://api.github.com/repos/trivago/gollum/languages","stargazers_url":"https://api.github.com/repos/trivago/gollum/stargazers","contributors_url":"https://api.github.com/repos/trivago/gollum/contributors","subscribers_url":"https://api.github.com/repos/trivago/gollum/subscribers","subscription_url":"https://api.github.com/repos/trivago/gollum/subscription","commits_url":"https://api.github.com/repos/trivago/gollum/commits{/sha}","git_commits_url":"https://api.github.com/repos/trivago/gollum/git/commits{/sha}","comments_url":"https://api.github.com/repos/trivago/gollum/comments{/number}","issue_comment_url":"https://api.github.com/repos/trivago/gollum/issues/comments{/number}","contents_url":"https://api.github.com/repos/trivago/gollum/contents/{+path}","compare_url":"https://api.github.com/repos/trivago/gollum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trivago/gollum/merges","archive_url":"https://api.github.com/repos/trivago/gollum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trivago/gollum/downloads","issues_url":"https://api.github.com/repos/trivago/gollum/issues{/number}","pulls_url":"https://api.github.com/repos/trivago/gollum/pulls{/number}","milestones_url":"https://api.github.com/repos/trivago/gollum/milestones{/number}","notifications_url":"https://api.github.com/repos/trivago/gollum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trivago/gollum/labels{/name}","releases_url":"https://api.github.com/repos/trivago/gollum/releases{/id}","deployments_url":"https://api.github.com/repos/trivago/gollum/deployments","created_at":"2015-06-20T21:51:20Z","updated_at":"2017-04-21T05:38:07Z","pushed_at":"2017-04-28T01:03:37Z","git_url":"git://github.com/trivago/gollum.git","ssh_url":"git@github.com:trivago/gollum.git","clone_url":"https://github.com/trivago/gollum.git","svn_url":"https://github.com/trivago/gollum","homepage":"http://gollum.readthedocs.org/en/latest/","size":15781,"stargazers_count":516,"watchers_count":516,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":25,"forks":48,"open_issues":25,"watchers":516,"default_branch":"master"}},"base":{"label":"trivago:master","ref":"master","sha":"2a45294e1101ebf04040e4f888a088b03278c626","user":{"login":"trivago","id":1481788,"avatar_url":"https://avatars2.githubusercontent.com/u/1481788?v=3","gravatar_id":"","url":"https://api.github.com/users/trivago","html_url":"https://github.com/trivago","followers_url":"https://api.github.com/users/trivago/followers","following_url":"https://api.github.com/users/trivago/following{/other_user}","gists_url":"https://api.github.com/users/trivago/gists{/gist_id}","starred_url":"https://api.github.com/users/trivago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trivago/subscriptions","organizations_url":"https://api.github.com/users/trivago/orgs","repos_url":"https://api.github.com/users/trivago/repos","events_url":"https://api.github.com/users/trivago/events{/privacy}","received_events_url":"https://api.github.com/users/trivago/received_events","type":"Organization","site_admin":false},"repo":{"id":37787279,"name":"gollum","full_name":"trivago/gollum","owner":{"login":"trivago","id":1481788,"avatar_url":"https://avatars2.githubusercontent.com/u/1481788?v=3","gravatar_id":"","url":"https://api.github.com/users/trivago","html_url":"https://github.com/trivago","followers_url":"https://api.github.com/users/trivago/followers","following_url":"https://api.github.com/users/trivago/following{/other_user}","gists_url":"https://api.github.com/users/trivago/gists{/gist_id}","starred_url":"https://api.github.com/users/trivago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trivago/subscriptions","organizations_url":"https://api.github.com/users/trivago/orgs","repos_url":"https://api.github.com/users/trivago/repos","events_url":"https://api.github.com/users/trivago/events{/privacy}","received_events_url":"https://api.github.com/users/trivago/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trivago/gollum","description":"An n:m message multiplexer written in Go","fork":false,"url":"https://api.github.com/repos/trivago/gollum","forks_url":"https://api.github.com/repos/trivago/gollum/forks","keys_url":"https://api.github.com/repos/trivago/gollum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trivago/gollum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trivago/gollum/teams","hooks_url":"https://api.github.com/repos/trivago/gollum/hooks","issue_events_url":"https://api.github.com/repos/trivago/gollum/issues/events{/number}","events_url":"https://api.github.com/repos/trivago/gollum/events","assignees_url":"https://api.github.com/repos/trivago/gollum/assignees{/user}","branches_url":"https://api.github.com/repos/trivago/gollum/branches{/branch}","tags_url":"https://api.github.com/repos/trivago/gollum/tags","blobs_url":"https://api.github.com/repos/trivago/gollum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trivago/gollum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trivago/gollum/git/refs{/sha}","trees_url":"https://api.github.com/repos/trivago/gollum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trivago/gollum/statuses/{sha}","languages_url":"https://api.github.com/repos/trivago/gollum/languages","stargazers_url":"https://api.github.com/repos/trivago/gollum/stargazers","contributors_url":"https://api.github.com/repos/trivago/gollum/contributors","subscribers_url":"https://api.github.com/repos/trivago/gollum/subscribers","subscription_url":"https://api.github.com/repos/trivago/gollum/subscription","commits_url":"https://api.github.com/repos/trivago/gollum/commits{/sha}","git_commits_url":"https://api.github.com/repos/trivago/gollum/git/commits{/sha}","comments_url":"https://api.github.com/repos/trivago/gollum/comments{/number}","issue_comment_url":"https://api.github.com/repos/trivago/gollum/issues/comments{/number}","contents_url":"https://api.github.com/repos/trivago/gollum/contents/{+path}","compare_url":"https://api.github.com/repos/trivago/gollum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trivago/gollum/merges","archive_url":"https://api.github.com/repos/trivago/gollum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trivago/gollum/downloads","issues_url":"https://api.github.com/repos/trivago/gollum/issues{/number}","pulls_url":"https://api.github.com/repos/trivago/gollum/pulls{/number}","milestones_url":"https://api.github.com/repos/trivago/gollum/milestones{/number}","notifications_url":"https://api.github.com/repos/trivago/gollum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trivago/gollum/labels{/name}","releases_url":"https://api.github.com/repos/trivago/gollum/releases{/id}","deployments_url":"https://api.github.com/repos/trivago/gollum/deployments","created_at":"2015-06-20T21:51:20Z","updated_at":"2017-04-21T05:38:07Z","pushed_at":"2017-04-28T01:03:37Z","git_url":"git://github.com/trivago/gollum.git","ssh_url":"git@github.com:trivago/gollum.git","clone_url":"https://github.com/trivago/gollum.git","svn_url":"https://github.com/trivago/gollum","homepage":"http://gollum.readthedocs.org/en/latest/","size":15781,"stargazers_count":516,"watchers_count":516,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":25,"forks":48,"open_issues":25,"watchers":516,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trivago/gollum/pulls/105"},"html":{"href":"https://github.com/trivago/gollum/pull/105"},"issue":{"href":"https://api.github.com/repos/trivago/gollum/issues/105"},"comments":{"href":"https://api.github.com/repos/trivago/gollum/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/trivago/gollum/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/trivago/gollum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trivago/gollum/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/trivago/gollum/statuses/fd2365766fb501ee151e225ac4b99979b1513f6d"}}}}
{"actor":{"display_login":"arnecls"}}