{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/42406706","id":42406706,"diff_hunk":"@@ -0,0 +1,110 @@\n+<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->\n+\n+<!-- BEGIN STRIP_FOR_RELEASE -->\n+\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+\n+<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>\n+\n+If you are using a released version of Kubernetes, you should\n+refer to the docs that go with that version.\n+\n+<strong>\n+The latest 1.0.x release of this document can be found\n+[here](http://releases.k8s.io/release-1.0/docs/proposals/compute-resource-metrics-api.md).\n+\n+Documentation for other releases can be found at\n+[releases.k8s.io](http://releases.k8s.io).\n+</strong>\n+--\n+\n+<!-- END STRIP_FOR_RELEASE -->\n+\n+<!-- END MUNGE: UNVERSIONED_WARNING -->\n+\n+# Kubelet raw metrics API\n+\n+Kubelet currently exposes raw container metrics through the `/stats/` endpoint\n+that serves raw container stats. However, this endpoint serves individual\n+container stats, and applications like heapster, which aggregates metrics across\n+the cluster, must repeatedly query for each container. The high QPS combined\n+with the potential data size of raw stats puts unnecessary load on the system\n+that could be avoided with an aggregate API.\n+\n+## Requirements:\n+- Provide machine level metrics, all pod metrics (in single request), specific\n+  pod metrics\n+- Ability to authenticate machine & pod metrics independently from each other\n+- Eventually support multiple kinds of metrics (e.g. derived/aggregate type)\n+- Follow existing API conventions, fully compatible types able to eventually be\n+  served by apiserver library\n+\n+## Design\n+\n+Kubelet will start providing a versioned API, following convensions of the API\n+server. The metrics API will be its own [API group](api-group.md), and may\n+eventually be reused at the cluster-level (outside the scope of this proposal).\n+\n+### Endpoints\n+\n+All endpoints are GET endpoints, rooted at `/apis/metrics/v1alpha1/`\n+\n+- `/` - discovery endpoint; type resource list\n+- `/nodes` - host metrics; type `[]metrics.Node`\n+  - `/nodes/localhost` - When served by kubelet, the only node provided is\n+    `localhost`; type metrics.Node\n+- `/pods` - All pod metrics across all namespaces; type `[]metrics.Pod`\n+- `/namespaces/{namespace}/pods` - All pod metrics within namespace; type\n+  `[]metrics.Pod`\n+- `/namespaces/{namespace}/pods/{pod}` - metrics for specific pod; type\n+  `metrics.Pod`\n+- Unsupported paths return status not found (404)\n+  - `/namespaces/`\n+  - `/namespaces/{namespace}`\n+\n+Additionally, all endpoints (except root discovery endpoint) support the\n+following optional query parameters:\n+\n+- `start` - start time to return metrics from; type json encoded `time.Time`\n+- `end` - end time to return metrics to; type json encoded `time.Time`\n+- `count` - maximum number of stats to return in each ContainerMetrics instance;\n+  type int","path":"docs/proposals/kubelet-raw-metrics-api.md","position":80,"original_position":80,"commit_id":"05794bcf947ab20f2de6f12d75f61c43667d9b79","original_commit_id":"05794bcf947ab20f2de6f12d75f61c43667d9b79","user":{"login":"timstclair","id":3272040,"avatar_url":"https://avatars.githubusercontent.com/u/3272040?v=3","gravatar_id":"","url":"https://api.github.com/users/timstclair","html_url":"https://github.com/timstclair","followers_url":"https://api.github.com/users/timstclair/followers","following_url":"https://api.github.com/users/timstclair/following{/other_user}","gists_url":"https://api.github.com/users/timstclair/gists{/gist_id}","starred_url":"https://api.github.com/users/timstclair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timstclair/subscriptions","organizations_url":"https://api.github.com/users/timstclair/orgs","repos_url":"https://api.github.com/users/timstclair/repos","events_url":"https://api.github.com/users/timstclair/events{/privacy}","received_events_url":"https://api.github.com/users/timstclair/received_events","type":"User","site_admin":false},"body":"As @lavalamp says, this is \"poor-man's paging\" -- Is there a better way to structure this parameter to support proper paging in the future (e.g. should this be max total stats, as opposed to max per-container stats?)","created_at":"2015-10-19T18:18:39Z","updated_at":"2015-10-19T18:18:39Z","html_url":"https://github.com/kubernetes/kubernetes/pull/15862#discussion_r42406706","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15862","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/42406706"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/15862#discussion_r42406706"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15862"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15862","id":48106674,"html_url":"https://github.com/kubernetes/kubernetes/pull/15862","diff_url":"https://github.com/kubernetes/kubernetes/pull/15862.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/15862.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/15862","number":15862,"state":"open","locked":false,"title":"Kubelet raw metrics API proposal","user":{"login":"timstclair","id":3272040,"avatar_url":"https://avatars.githubusercontent.com/u/3272040?v=3","gravatar_id":"","url":"https://api.github.com/users/timstclair","html_url":"https://github.com/timstclair","followers_url":"https://api.github.com/users/timstclair/followers","following_url":"https://api.github.com/users/timstclair/following{/other_user}","gists_url":"https://api.github.com/users/timstclair/gists{/gist_id}","starred_url":"https://api.github.com/users/timstclair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timstclair/subscriptions","organizations_url":"https://api.github.com/users/timstclair/orgs","repos_url":"https://api.github.com/users/timstclair/repos","events_url":"https://api.github.com/users/timstclair/events{/privacy}","received_events_url":"https://api.github.com/users/timstclair/received_events","type":"User","site_admin":false},"body":"Forked from discussion on https://github.com/kubernetes/kubernetes/pull/15691\r\nAddresses https://github.com/kubernetes/kubernetes/issues/12483\r\n\r\ncc/ @vishh @jimmidyson @dchen1107 @bgrant0607","created_at":"2015-10-19T18:17:31Z","updated_at":"2015-10-19T18:18:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3d35971975458c584494c0329e2ecc8a08b3827","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15862/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15862/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/15862/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/05794bcf947ab20f2de6f12d75f61c43667d9b79","head":{"label":"timstclair:metrics-proposal","ref":"metrics-proposal","sha":"05794bcf947ab20f2de6f12d75f61c43667d9b79","user":{"login":"timstclair","id":3272040,"avatar_url":"https://avatars.githubusercontent.com/u/3272040?v=3","gravatar_id":"","url":"https://api.github.com/users/timstclair","html_url":"https://github.com/timstclair","followers_url":"https://api.github.com/users/timstclair/followers","following_url":"https://api.github.com/users/timstclair/following{/other_user}","gists_url":"https://api.github.com/users/timstclair/gists{/gist_id}","starred_url":"https://api.github.com/users/timstclair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timstclair/subscriptions","organizations_url":"https://api.github.com/users/timstclair/orgs","repos_url":"https://api.github.com/users/timstclair/repos","events_url":"https://api.github.com/users/timstclair/events{/privacy}","received_events_url":"https://api.github.com/users/timstclair/received_events","type":"User","site_admin":false},"repo":{"id":36760336,"name":"kubernetes","full_name":"timstclair/kubernetes","owner":{"login":"timstclair","id":3272040,"avatar_url":"https://avatars.githubusercontent.com/u/3272040?v=3","gravatar_id":"","url":"https://api.github.com/users/timstclair","html_url":"https://github.com/timstclair","followers_url":"https://api.github.com/users/timstclair/followers","following_url":"https://api.github.com/users/timstclair/following{/other_user}","gists_url":"https://api.github.com/users/timstclair/gists{/gist_id}","starred_url":"https://api.github.com/users/timstclair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timstclair/subscriptions","organizations_url":"https://api.github.com/users/timstclair/orgs","repos_url":"https://api.github.com/users/timstclair/repos","events_url":"https://api.github.com/users/timstclair/events{/privacy}","received_events_url":"https://api.github.com/users/timstclair/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timstclair/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/timstclair/kubernetes","forks_url":"https://api.github.com/repos/timstclair/kubernetes/forks","keys_url":"https://api.github.com/repos/timstclair/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timstclair/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timstclair/kubernetes/teams","hooks_url":"https://api.github.com/repos/timstclair/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/timstclair/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/timstclair/kubernetes/events","assignees_url":"https://api.github.com/repos/timstclair/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/timstclair/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/timstclair/kubernetes/tags","blobs_url":"https://api.github.com/repos/timstclair/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timstclair/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timstclair/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/timstclair/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timstclair/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/timstclair/kubernetes/languages","stargazers_url":"https://api.github.com/repos/timstclair/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/timstclair/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/timstclair/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/timstclair/kubernetes/subscription","commits_url":"https://api.github.com/repos/timstclair/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/timstclair/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/timstclair/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/timstclair/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/timstclair/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/timstclair/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timstclair/kubernetes/merges","archive_url":"https://api.github.com/repos/timstclair/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timstclair/kubernetes/downloads","issues_url":"https://api.github.com/repos/timstclair/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/timstclair/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/timstclair/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/timstclair/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timstclair/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/timstclair/kubernetes/releases{/id}","created_at":"2015-06-02T20:36:50Z","updated_at":"2015-06-13T04:34:00Z","pushed_at":"2015-10-19T18:09:56Z","git_url":"git://github.com/timstclair/kubernetes.git","ssh_url":"git@github.com:timstclair/kubernetes.git","clone_url":"https://github.com/timstclair/kubernetes.git","svn_url":"https://github.com/timstclair/kubernetes","homepage":"http://kubernetes.io","size":117761,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"ac5524d84dfcf01f1a532a7da2402905d38ab79a","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","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://avatars.githubusercontent.com/u/13629408?v=3","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":"Container Cluster Manager from Google","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}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-10-19T18:06:19Z","pushed_at":"2015-10-19T18:17:32Z","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":472942,"stargazers_count":10769,"watchers_count":10769,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2730,"mirror_url":null,"open_issues_count":2036,"forks":2730,"open_issues":2036,"watchers":10769,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15862"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/15862"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/15862"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/15862/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15862/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15862/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/05794bcf947ab20f2de6f12d75f61c43667d9b79"}}}}