{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/166908275","pull_request_review_id":95041726,"id":166908275,"diff_hunk":"@@ -202,7 +202,29 @@ func InstrumentRouteFunc(verb, resource, subresource, scope string, routeFunc re\n \t})\n }\n \n-func cleanScope(requestInfo *request.RequestInfo) string {\n+// InstrumentHandlerFunc works like Prometheus' InstrumentHandlerFunc but adds some Kubernetes endpoint specific information.\n+func InstrumentHandlerFunc(verb, resource, subresource, scope string, handler http.HandlerFunc) http.HandlerFunc {\n+\treturn func(w http.ResponseWriter, req *http.Request) {\n+\t\tnow := time.Now()\n+\n+\t\tdelegate := &ResponseWriterDelegator{ResponseWriter: w}\n+\n+\t\t_, cn := w.(http.CloseNotifier)\n+\t\t_, fl := w.(http.Flusher)\n+\t\t_, hj := w.(http.Hijacker)\n+\t\tif cn && fl && hj {\n+\t\t\tw = &fancyResponseWriterDelegator{delegate}\n+\t\t} else {\n+\t\t\tw = delegate\n+\t\t}\n+\n+\t\thandler(w, req)\n+\n+\t\tMonitorRequest(req, verb, resource, subresource, scope, delegate.Header().Get(\"Content-Type\"), delegate.Status(), delegate.ContentLength(), time.Now().Sub(now))\n+\t}\n+}\n+\n+func CleanScope(requestInfo *request.RequestInfo) string {","path":"staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go","position":null,"original_position":54,"commit_id":"60438762d189b3eb1411ece65cd1eca66443b2af","original_commit_id":"e03a11be7c8460aea96f8f11eea22080bceece1a","user":{"login":"nikhita","id":16105680,"avatar_url":"https://avatars1.githubusercontent.com/u/16105680?v=4","gravatar_id":"","url":"https://api.github.com/users/nikhita","html_url":"https://github.com/nikhita","followers_url":"https://api.github.com/users/nikhita/followers","following_url":"https://api.github.com/users/nikhita/following{/other_user}","gists_url":"https://api.github.com/users/nikhita/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhita/subscriptions","organizations_url":"https://api.github.com/users/nikhita/orgs","repos_url":"https://api.github.com/users/nikhita/repos","events_url":"https://api.github.com/users/nikhita/events{/privacy}","received_events_url":"https://api.github.com/users/nikhita/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2018-02-08T11:37:00Z","updated_at":"2018-02-08T11:37:00Z","html_url":"https://github.com/kubernetes/kubernetes/pull/57682#discussion_r166908275","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/57682","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/166908275"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/57682#discussion_r166908275"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/57682"}},"in_reply_to_id":166868812},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/57682","id":160357662,"html_url":"https://github.com/kubernetes/kubernetes/pull/57682","diff_url":"https://github.com/kubernetes/kubernetes/pull/57682.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/57682.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/57682","number":57682,"state":"open","locked":false,"title":"Collect prometheus metrics for custom resources","user":{"login":"nikhita","id":16105680,"avatar_url":"https://avatars1.githubusercontent.com/u/16105680?v=4","gravatar_id":"","url":"https://api.github.com/users/nikhita","html_url":"https://github.com/nikhita","followers_url":"https://api.github.com/users/nikhita/followers","following_url":"https://api.github.com/users/nikhita/following{/other_user}","gists_url":"https://api.github.com/users/nikhita/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhita/subscriptions","organizations_url":"https://api.github.com/users/nikhita/orgs","repos_url":"https://api.github.com/users/nikhita/repos","events_url":"https://api.github.com/users/nikhita/events{/privacy}","received_events_url":"https://api.github.com/users/nikhita/received_events","type":"User","site_admin":false},"body":"Enables apiserver metrics for custom resources.\r\n\r\nFixes #55146\r\n\r\n**Release note**:\r\n<!--  Write your release note:\r\n1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string \"action required\".\r\n2. If no release note is required, just write \"NONE\".\r\n-->\r\n```release-note\r\nEnable apiserver metrics for custom resources.\r\n```\r\n\r\n/cc sttts deads2k kargakis brancz ","created_at":"2017-12-28T09:18:59Z","updated_at":"2018-02-08T11:37:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4539e88026be839952130dbe7ab604fe382e4303","assignee":{"login":"enisoc","id":6733629,"avatar_url":"https://avatars3.githubusercontent.com/u/6733629?v=4","gravatar_id":"","url":"https://api.github.com/users/enisoc","html_url":"https://github.com/enisoc","followers_url":"https://api.github.com/users/enisoc/followers","following_url":"https://api.github.com/users/enisoc/following{/other_user}","gists_url":"https://api.github.com/users/enisoc/gists{/gist_id}","starred_url":"https://api.github.com/users/enisoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enisoc/subscriptions","organizations_url":"https://api.github.com/users/enisoc/orgs","repos_url":"https://api.github.com/users/enisoc/repos","events_url":"https://api.github.com/users/enisoc/events{/privacy}","received_events_url":"https://api.github.com/users/enisoc/received_events","type":"User","site_admin":false},"assignees":[{"login":"sttts","id":730123,"avatar_url":"https://avatars0.githubusercontent.com/u/730123?v=4","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},{"login":"enisoc","id":6733629,"avatar_url":"https://avatars3.githubusercontent.com/u/6733629?v=4","gravatar_id":"","url":"https://api.github.com/users/enisoc","html_url":"https://github.com/enisoc","followers_url":"https://api.github.com/users/enisoc/followers","following_url":"https://api.github.com/users/enisoc/following{/other_user}","gists_url":"https://api.github.com/users/enisoc/gists{/gist_id}","starred_url":"https://api.github.com/users/enisoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enisoc/subscriptions","organizations_url":"https://api.github.com/users/enisoc/orgs","repos_url":"https://api.github.com/users/enisoc/repos","events_url":"https://api.github.com/users/enisoc/events{/privacy}","received_events_url":"https://api.github.com/users/enisoc/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"kargakis","id":3900799,"avatar_url":"https://avatars3.githubusercontent.com/u/3900799?v=4","gravatar_id":"","url":"https://api.github.com/users/kargakis","html_url":"https://github.com/kargakis","followers_url":"https://api.github.com/users/kargakis/followers","following_url":"https://api.github.com/users/kargakis/following{/other_user}","gists_url":"https://api.github.com/users/kargakis/gists{/gist_id}","starred_url":"https://api.github.com/users/kargakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kargakis/subscriptions","organizations_url":"https://api.github.com/users/kargakis/orgs","repos_url":"https://api.github.com/users/kargakis/repos","events_url":"https://api.github.com/users/kargakis/events{/privacy}","received_events_url":"https://api.github.com/users/kargakis/received_events","type":"User","site_admin":false},{"login":"deads2k","id":8225098,"avatar_url":"https://avatars0.githubusercontent.com/u/8225098?v=4","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/57682/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/57682/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/57682/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/60438762d189b3eb1411ece65cd1eca66443b2af","head":{"label":"nikhita:customresource-metrics","ref":"customresource-metrics","sha":"60438762d189b3eb1411ece65cd1eca66443b2af","user":{"login":"nikhita","id":16105680,"avatar_url":"https://avatars1.githubusercontent.com/u/16105680?v=4","gravatar_id":"","url":"https://api.github.com/users/nikhita","html_url":"https://github.com/nikhita","followers_url":"https://api.github.com/users/nikhita/followers","following_url":"https://api.github.com/users/nikhita/following{/other_user}","gists_url":"https://api.github.com/users/nikhita/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhita/subscriptions","organizations_url":"https://api.github.com/users/nikhita/orgs","repos_url":"https://api.github.com/users/nikhita/repos","events_url":"https://api.github.com/users/nikhita/events{/privacy}","received_events_url":"https://api.github.com/users/nikhita/received_events","type":"User","site_admin":false},"repo":{"id":84678935,"name":"kubernetes","full_name":"nikhita/kubernetes","owner":{"login":"nikhita","id":16105680,"avatar_url":"https://avatars1.githubusercontent.com/u/16105680?v=4","gravatar_id":"","url":"https://api.github.com/users/nikhita","html_url":"https://github.com/nikhita","followers_url":"https://api.github.com/users/nikhita/followers","following_url":"https://api.github.com/users/nikhita/following{/other_user}","gists_url":"https://api.github.com/users/nikhita/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhita/subscriptions","organizations_url":"https://api.github.com/users/nikhita/orgs","repos_url":"https://api.github.com/users/nikhita/repos","events_url":"https://api.github.com/users/nikhita/events{/privacy}","received_events_url":"https://api.github.com/users/nikhita/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nikhita/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/nikhita/kubernetes","forks_url":"https://api.github.com/repos/nikhita/kubernetes/forks","keys_url":"https://api.github.com/repos/nikhita/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikhita/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikhita/kubernetes/teams","hooks_url":"https://api.github.com/repos/nikhita/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/nikhita/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/nikhita/kubernetes/events","assignees_url":"https://api.github.com/repos/nikhita/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/nikhita/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/nikhita/kubernetes/tags","blobs_url":"https://api.github.com/repos/nikhita/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikhita/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikhita/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikhita/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikhita/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/nikhita/kubernetes/languages","stargazers_url":"https://api.github.com/repos/nikhita/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/nikhita/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/nikhita/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/nikhita/kubernetes/subscription","commits_url":"https://api.github.com/repos/nikhita/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikhita/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikhita/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikhita/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikhita/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/nikhita/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikhita/kubernetes/merges","archive_url":"https://api.github.com/repos/nikhita/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikhita/kubernetes/downloads","issues_url":"https://api.github.com/repos/nikhita/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/nikhita/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/nikhita/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/nikhita/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikhita/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/nikhita/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/nikhita/kubernetes/deployments","created_at":"2017-03-11T20:49:10Z","updated_at":"2017-03-11T20:49:40Z","pushed_at":"2018-02-08T11:35:29Z","git_url":"git://github.com/nikhita/kubernetes.git","ssh_url":"git@github.com:nikhita/kubernetes.git","clone_url":"https://github.com/nikhita/kubernetes.git","svn_url":"https://github.com/nikhita/kubernetes","homepage":"http://kubernetes.io","size":529968,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"b9361192b806df8a9f4108d97f3fe47ac61d1ccf","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2018-02-08T11:22:53Z","pushed_at":"2018-02-08T11:35:35Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":751291,"stargazers_count":32303,"watchers_count":32303,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11428,"mirror_url":null,"archived":false,"open_issues_count":5314,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":11428,"open_issues":5314,"watchers":32303,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/57682"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/57682"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/57682"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/57682/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/57682/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/57682/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/60438762d189b3eb1411ece65cd1eca66443b2af"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nikhita"}}