{"action":"created","comment":{"url":"https://api.github.com/repos/zalando/skipper/pulls/comments/172798670","pull_request_review_id":101875966,"id":172798670,"diff_hunk":"@@ -0,0 +1,99 @@\n+package metrics\n+\n+import (\n+\t\"net/http\"\n+\t\"time\"\n+)\n+\n+type All struct {\n+\tprometheus      *Prometheus\n+\tcodaHale        *CodaHale\n+\tprommHandler    http.Handler\n+\tcodaHaleHandler http.Handler\n+}\n+\n+func NewAll(o Options) *All {\n+\treturn &All{\n+\t\tprometheus: NewPrometheus(o),\n+\t\tcodaHale:   NewCodaHale(o),\n+\t}\n+}\n+\n+func (a *All) MeasureSince(key string, start time.Time) {\n+\ta.prometheus.MeasureSince(key, start)\n+\ta.codaHale.MeasureSince(key, start)\n+}\n+func (a *All) IncCounter(key string) {\n+\ta.prometheus.IncCounter(key)\n+\ta.codaHale.IncCounter(key)\n+\n+}\n+func (a *All) MeasureRouteLookup(start time.Time) {\n+\ta.prometheus.MeasureRouteLookup(start)\n+\ta.codaHale.MeasureRouteLookup(start)\n+}\n+func (a *All) MeasureFilterRequest(filterName string, start time.Time) {\n+\ta.prometheus.MeasureFilterRequest(filterName, start)\n+\ta.codaHale.MeasureFilterRequest(filterName, start)\n+}\n+func (a *All) MeasureAllFiltersRequest(routeId string, start time.Time) {\n+\ta.prometheus.MeasureAllFiltersRequest(routeId, start)\n+\ta.codaHale.MeasureAllFiltersRequest(routeId, start)\n+}\n+func (a *All) MeasureBackend(routeId string, start time.Time) {\n+\ta.prometheus.MeasureBackend(routeId, start)\n+\ta.codaHale.MeasureBackend(routeId, start)\n+}\n+func (a *All) MeasureBackendHost(routeBackendHost string, start time.Time) {\n+\ta.prometheus.MeasureBackendHost(routeBackendHost, start)\n+\ta.codaHale.MeasureBackendHost(routeBackendHost, start)\n+}\n+func (a *All) MeasureFilterResponse(filterName string, start time.Time) {\n+\ta.prometheus.MeasureFilterResponse(filterName, start)\n+\ta.codaHale.MeasureFilterResponse(filterName, start)\n+}\n+func (a *All) MeasureAllFiltersResponse(routeId string, start time.Time) {\n+\ta.prometheus.MeasureAllFiltersResponse(routeId, start)\n+\ta.codaHale.MeasureAllFiltersResponse(routeId, start)\n+}\n+func (a *All) MeasureResponse(code int, method string, routeId string, start time.Time) {\n+\ta.prometheus.MeasureResponse(code, method, routeId, start)\n+\ta.codaHale.MeasureResponse(code, method, routeId, start)\n+}\n+func (a *All) MeasureServe(routeId, host, method string, code int, start time.Time) {\n+\ta.prometheus.MeasureServe(routeId, host, method, code, start)\n+\ta.codaHale.MeasureServe(routeId, host, method, code, start)\n+}\n+func (a *All) IncRoutingFailures() {\n+\ta.prometheus.IncRoutingFailures()\n+\ta.codaHale.IncRoutingFailures()\n+}\n+func (a *All) IncErrorsBackend(routeId string) {\n+\ta.prometheus.IncErrorsBackend(routeId)\n+\ta.codaHale.IncErrorsBackend(routeId)\n+}\n+func (a *All) MeasureBackend5xx(t time.Time) {\n+\ta.prometheus.MeasureBackend5xx(t)\n+\ta.codaHale.MeasureBackend5xx(t)\n+\n+}\n+func (a *All) IncErrorsStreaming(routeId string) {\n+\ta.prometheus.IncErrorsStreaming(routeId)\n+\ta.codaHale.IncErrorsStreaming(routeId)\n+\n+}\n+func (a *All) RegisterHandler(path string, handler *http.ServeMux) {\n+\ta.prommHandler = a.prometheus.CreateHandler()\n+\ta.codaHaleHandler = a.codaHale.CreateHandler(path)\n+\thandler.Handle(path, a.newHandler())\n+}\n+\n+func (a *All) newHandler() http.Handler {\n+\treturn http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n+\t\tif req.Header.Get(\"Accept\") == \"application/json\" {","path":"metrics/all_kind.go","position":93,"original_position":93,"commit_id":"5f3198ba496d553ef3b54333ff150f4a7661047f","original_commit_id":"d0cd602b958c3cb6624665d2d861c688cdb1b235","user":{"login":"aryszka","id":733217,"avatar_url":"https://avatars0.githubusercontent.com/u/733217?v=4","gravatar_id":"","url":"https://api.github.com/users/aryszka","html_url":"https://github.com/aryszka","followers_url":"https://api.github.com/users/aryszka/followers","following_url":"https://api.github.com/users/aryszka/following{/other_user}","gists_url":"https://api.github.com/users/aryszka/gists{/gist_id}","starred_url":"https://api.github.com/users/aryszka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aryszka/subscriptions","organizations_url":"https://api.github.com/users/aryszka/orgs","repos_url":"https://api.github.com/users/aryszka/repos","events_url":"https://api.github.com/users/aryszka/events{/privacy}","received_events_url":"https://api.github.com/users/aryszka/received_events","type":"User","site_admin":false},"body":"i am thinking about using different paths for the different metrics. E.g:\r\n\r\n/ -> the current default\r\n/codahale -> codahale if enabled or 404\r\n/prometheus -> prometheus if enabled or 404\r\n\r\nnot sure if the above is the best, but i agree with @Raffo 's comment that the mime type doesn't represent the types that we're choosing from.","created_at":"2018-03-07T10:28:53Z","updated_at":"2018-03-07T10:28:53Z","html_url":"https://github.com/zalando/skipper/pull/569#discussion_r172798670","pull_request_url":"https://api.github.com/repos/zalando/skipper/pulls/569","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/zalando/skipper/pulls/comments/172798670"},"html":{"href":"https://github.com/zalando/skipper/pull/569#discussion_r172798670"},"pull_request":{"href":"https://api.github.com/repos/zalando/skipper/pulls/569"}},"in_reply_to_id":172773765},"pull_request":{"url":"https://api.github.com/repos/zalando/skipper/pulls/569","id":173294152,"html_url":"https://github.com/zalando/skipper/pull/569","diff_url":"https://github.com/zalando/skipper/pull/569.diff","patch_url":"https://github.com/zalando/skipper/pull/569.patch","issue_url":"https://api.github.com/repos/zalando/skipper/issues/569","number":569,"state":"open","locked":false,"title":"Feature/add migration path for metrics","user":{"login":"szuecs","id":50872,"avatar_url":"https://avatars2.githubusercontent.com/u/50872?v=4","gravatar_id":"","url":"https://api.github.com/users/szuecs","html_url":"https://github.com/szuecs","followers_url":"https://api.github.com/users/szuecs/followers","following_url":"https://api.github.com/users/szuecs/following{/other_user}","gists_url":"https://api.github.com/users/szuecs/gists{/gist_id}","starred_url":"https://api.github.com/users/szuecs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szuecs/subscriptions","organizations_url":"https://api.github.com/users/szuecs/orgs","repos_url":"https://api.github.com/users/szuecs/repos","events_url":"https://api.github.com/users/szuecs/events{/privacy}","received_events_url":"https://api.github.com/users/szuecs/received_events","type":"User","site_admin":false},"body":"This change will make it possible to serve prometheus and codahale metrics.\r\nTo get codahale metrics you have to send an \"Accept\" header \"application/json\", else skipper will serve prometheus metrics.","created_at":"2018-03-06T22:00:50Z","updated_at":"2018-03-07T10:28:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd7c17f864aa6a410b153db1b531dd3072bdc415","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zalando/skipper/pulls/569/commits","review_comments_url":"https://api.github.com/repos/zalando/skipper/pulls/569/comments","review_comment_url":"https://api.github.com/repos/zalando/skipper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zalando/skipper/issues/569/comments","statuses_url":"https://api.github.com/repos/zalando/skipper/statuses/5f3198ba496d553ef3b54333ff150f4a7661047f","head":{"label":"zalando:feature/add-migration-path-for-metrics","ref":"feature/add-migration-path-for-metrics","sha":"5f3198ba496d553ef3b54333ff150f4a7661047f","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars0.githubusercontent.com/u/1564818?v=4","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":38812664,"name":"skipper","full_name":"zalando/skipper","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars0.githubusercontent.com/u/1564818?v=4","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/skipper","description":"An HTTP router and reverse proxy for service composition","fork":false,"url":"https://api.github.com/repos/zalando/skipper","forks_url":"https://api.github.com/repos/zalando/skipper/forks","keys_url":"https://api.github.com/repos/zalando/skipper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/skipper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/skipper/teams","hooks_url":"https://api.github.com/repos/zalando/skipper/hooks","issue_events_url":"https://api.github.com/repos/zalando/skipper/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/skipper/events","assignees_url":"https://api.github.com/repos/zalando/skipper/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/skipper/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/skipper/tags","blobs_url":"https://api.github.com/repos/zalando/skipper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/skipper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/skipper/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/skipper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/skipper/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/skipper/languages","stargazers_url":"https://api.github.com/repos/zalando/skipper/stargazers","contributors_url":"https://api.github.com/repos/zalando/skipper/contributors","subscribers_url":"https://api.github.com/repos/zalando/skipper/subscribers","subscription_url":"https://api.github.com/repos/zalando/skipper/subscription","commits_url":"https://api.github.com/repos/zalando/skipper/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/skipper/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/skipper/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/skipper/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/skipper/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/skipper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/skipper/merges","archive_url":"https://api.github.com/repos/zalando/skipper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/skipper/downloads","issues_url":"https://api.github.com/repos/zalando/skipper/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/skipper/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/skipper/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/skipper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/skipper/labels{/name}","releases_url":"https://api.github.com/repos/zalando/skipper/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/skipper/deployments","created_at":"2015-07-09T09:54:40Z","updated_at":"2018-03-07T09:57:45Z","pushed_at":"2018-03-07T08:59:47Z","git_url":"git://github.com/zalando/skipper.git","ssh_url":"git@github.com:zalando/skipper.git","clone_url":"https://github.com/zalando/skipper.git","svn_url":"https://github.com/zalando/skipper","homepage":"","size":6815,"stargazers_count":870,"watchers_count":870,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":83,"mirror_url":null,"archived":false,"open_issues_count":92,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":83,"open_issues":92,"watchers":870,"default_branch":"master"}},"base":{"label":"zalando:master","ref":"master","sha":"36d4ee867d2df37bc6d562b0ef505272dc5fea6a","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars0.githubusercontent.com/u/1564818?v=4","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":38812664,"name":"skipper","full_name":"zalando/skipper","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars0.githubusercontent.com/u/1564818?v=4","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/skipper","description":"An HTTP router and reverse proxy for service composition","fork":false,"url":"https://api.github.com/repos/zalando/skipper","forks_url":"https://api.github.com/repos/zalando/skipper/forks","keys_url":"https://api.github.com/repos/zalando/skipper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/skipper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/skipper/teams","hooks_url":"https://api.github.com/repos/zalando/skipper/hooks","issue_events_url":"https://api.github.com/repos/zalando/skipper/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/skipper/events","assignees_url":"https://api.github.com/repos/zalando/skipper/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/skipper/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/skipper/tags","blobs_url":"https://api.github.com/repos/zalando/skipper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/skipper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/skipper/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/skipper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/skipper/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/skipper/languages","stargazers_url":"https://api.github.com/repos/zalando/skipper/stargazers","contributors_url":"https://api.github.com/repos/zalando/skipper/contributors","subscribers_url":"https://api.github.com/repos/zalando/skipper/subscribers","subscription_url":"https://api.github.com/repos/zalando/skipper/subscription","commits_url":"https://api.github.com/repos/zalando/skipper/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/skipper/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/skipper/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/skipper/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/skipper/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/skipper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/skipper/merges","archive_url":"https://api.github.com/repos/zalando/skipper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/skipper/downloads","issues_url":"https://api.github.com/repos/zalando/skipper/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/skipper/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/skipper/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/skipper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/skipper/labels{/name}","releases_url":"https://api.github.com/repos/zalando/skipper/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/skipper/deployments","created_at":"2015-07-09T09:54:40Z","updated_at":"2018-03-07T09:57:45Z","pushed_at":"2018-03-07T08:59:47Z","git_url":"git://github.com/zalando/skipper.git","ssh_url":"git@github.com:zalando/skipper.git","clone_url":"https://github.com/zalando/skipper.git","svn_url":"https://github.com/zalando/skipper","homepage":"","size":6815,"stargazers_count":870,"watchers_count":870,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":83,"mirror_url":null,"archived":false,"open_issues_count":92,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":83,"open_issues":92,"watchers":870,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zalando/skipper/pulls/569"},"html":{"href":"https://github.com/zalando/skipper/pull/569"},"issue":{"href":"https://api.github.com/repos/zalando/skipper/issues/569"},"comments":{"href":"https://api.github.com/repos/zalando/skipper/issues/569/comments"},"review_comments":{"href":"https://api.github.com/repos/zalando/skipper/pulls/569/comments"},"review_comment":{"href":"https://api.github.com/repos/zalando/skipper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zalando/skipper/pulls/569/commits"},"statuses":{"href":"https://api.github.com/repos/zalando/skipper/statuses/5f3198ba496d553ef3b54333ff150f4a7661047f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"aryszka"}}