{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/comments/235286803","pull_request_review_id":177114654,"id":235286803,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTI4NjgwMw==","diff_hunk":"@@ -0,0 +1,185 @@\n+/*\n+Copyright 2018 Google Inc.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package collector\n+\n+import (\n+\t\"bufio\"\n+\t\"fmt\"\n+\t\"io\"\n+\t\"os\"\n+\t\"strconv\"\n+\t\"strings\"\n+\n+\t\"github.com/prometheus/client_golang/prometheus\"\n+)\n+\n+type sockStatCollector struct {\n+\tsocketInUseDesc    *prometheus.Desc","path":"pkg/metrics/collector/sockstat.go","position":31,"original_position":31,"commit_id":"ea995abfbe88b46e4595702ef0123b9b7b1a817a","original_commit_id":"ea995abfbe88b46e4595702ef0123b9b7b1a817a","user":{"login":"bowei","id":837034,"node_id":"MDQ6VXNlcjgzNzAzNA==","avatar_url":"https://avatars1.githubusercontent.com/u/837034?v=4","gravatar_id":"","url":"https://api.github.com/users/bowei","html_url":"https://github.com/bowei","followers_url":"https://api.github.com/users/bowei/followers","following_url":"https://api.github.com/users/bowei/following{/other_user}","gists_url":"https://api.github.com/users/bowei/gists{/gist_id}","starred_url":"https://api.github.com/users/bowei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bowei/subscriptions","organizations_url":"https://api.github.com/users/bowei/orgs","repos_url":"https://api.github.com/users/bowei/repos","events_url":"https://api.github.com/users/bowei/events{/privacy}","received_events_url":"https://api.github.com/users/bowei/received_events","type":"User","site_admin":false},"body":"same as above","created_at":"2018-11-21T08:15:58Z","updated_at":"2018-11-21T08:20:58Z","html_url":"https://github.com/GoogleCloudPlatform/netd/pull/50#discussion_r235286803","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/50","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/comments/235286803"},"html":{"href":"https://github.com/GoogleCloudPlatform/netd/pull/50#discussion_r235286803"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/50","id":225851558,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1ODUxNTU4","html_url":"https://github.com/GoogleCloudPlatform/netd/pull/50","diff_url":"https://github.com/GoogleCloudPlatform/netd/pull/50.diff","patch_url":"https://github.com/GoogleCloudPlatform/netd/pull/50.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/issues/50","number":50,"state":"open","locked":false,"title":" Add network metrics collection","user":{"login":"lzang","id":8494751,"node_id":"MDQ6VXNlcjg0OTQ3NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/8494751?v=4","gravatar_id":"","url":"https://api.github.com/users/lzang","html_url":"https://github.com/lzang","followers_url":"https://api.github.com/users/lzang/followers","following_url":"https://api.github.com/users/lzang/following{/other_user}","gists_url":"https://api.github.com/users/lzang/gists{/gist_id}","starred_url":"https://api.github.com/users/lzang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzang/subscriptions","organizations_url":"https://api.github.com/users/lzang/orgs","repos_url":"https://api.github.com/users/lzang/repos","events_url":"https://api.github.com/users/lzang/events{/privacy}","received_events_url":"https://api.github.com/users/lzang/received_events","type":"User","site_admin":false},"body":"Add the network metrics collection logic to collect the following metrics:\r\n- conntrack entries: conntrack usage\r\n- conntrack_error_count (insert_failed, and drop) : A request from TSE due to the issue mentioned here \r\n     https://www.weave.works/blog/racy-conntrack-and-dns-lookup-timeouts\r\n- num_inuse_sockets(tcp, udp): this would help to tell if the node is under some sort of ddos attack, or a particular node has an unusually high number of connections.\r\n- num_tw_sockets: this can tell if there is a large number of short-lived sockets, which is often not desired.\r\n- socket_memory: the memory used by all sockets. When the memory hits the limit, the network becomes not usable. There is a request to add this metrics (https://github.com/kubernetes/kubernetes/issues/62334).\r\nAll these metrics can be obtained by read proc file directly (i.e. O(1) cost) . ","created_at":"2018-10-25T18:01:26Z","updated_at":"2018-11-21T08:20:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7fbdbf5d867c177fdde70ab27bb0120a09c22fd","assignee":{"login":"bowei","id":837034,"node_id":"MDQ6VXNlcjgzNzAzNA==","avatar_url":"https://avatars1.githubusercontent.com/u/837034?v=4","gravatar_id":"","url":"https://api.github.com/users/bowei","html_url":"https://github.com/bowei","followers_url":"https://api.github.com/users/bowei/followers","following_url":"https://api.github.com/users/bowei/following{/other_user}","gists_url":"https://api.github.com/users/bowei/gists{/gist_id}","starred_url":"https://api.github.com/users/bowei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bowei/subscriptions","organizations_url":"https://api.github.com/users/bowei/orgs","repos_url":"https://api.github.com/users/bowei/repos","events_url":"https://api.github.com/users/bowei/events{/privacy}","received_events_url":"https://api.github.com/users/bowei/received_events","type":"User","site_admin":false},"assignees":[{"login":"bowei","id":837034,"node_id":"MDQ6VXNlcjgzNzAzNA==","avatar_url":"https://avatars1.githubusercontent.com/u/837034?v=4","gravatar_id":"","url":"https://api.github.com/users/bowei","html_url":"https://github.com/bowei","followers_url":"https://api.github.com/users/bowei/followers","following_url":"https://api.github.com/users/bowei/following{/other_user}","gists_url":"https://api.github.com/users/bowei/gists{/gist_id}","starred_url":"https://api.github.com/users/bowei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bowei/subscriptions","organizations_url":"https://api.github.com/users/bowei/orgs","repos_url":"https://api.github.com/users/bowei/repos","events_url":"https://api.github.com/users/bowei/events{/privacy}","received_events_url":"https://api.github.com/users/bowei/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/50/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/50/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/issues/50/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/statuses/ea995abfbe88b46e4595702ef0123b9b7b1a817a","head":{"label":"lzang:dev","ref":"dev","sha":"ea995abfbe88b46e4595702ef0123b9b7b1a817a","user":{"login":"lzang","id":8494751,"node_id":"MDQ6VXNlcjg0OTQ3NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/8494751?v=4","gravatar_id":"","url":"https://api.github.com/users/lzang","html_url":"https://github.com/lzang","followers_url":"https://api.github.com/users/lzang/followers","following_url":"https://api.github.com/users/lzang/following{/other_user}","gists_url":"https://api.github.com/users/lzang/gists{/gist_id}","starred_url":"https://api.github.com/users/lzang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzang/subscriptions","organizations_url":"https://api.github.com/users/lzang/orgs","repos_url":"https://api.github.com/users/lzang/repos","events_url":"https://api.github.com/users/lzang/events{/privacy}","received_events_url":"https://api.github.com/users/lzang/received_events","type":"User","site_admin":false},"repo":{"id":152806309,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI4MDYzMDk=","name":"netd","full_name":"lzang/netd","private":false,"owner":{"login":"lzang","id":8494751,"node_id":"MDQ6VXNlcjg0OTQ3NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/8494751?v=4","gravatar_id":"","url":"https://api.github.com/users/lzang","html_url":"https://github.com/lzang","followers_url":"https://api.github.com/users/lzang/followers","following_url":"https://api.github.com/users/lzang/following{/other_user}","gists_url":"https://api.github.com/users/lzang/gists{/gist_id}","starred_url":"https://api.github.com/users/lzang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzang/subscriptions","organizations_url":"https://api.github.com/users/lzang/orgs","repos_url":"https://api.github.com/users/lzang/repos","events_url":"https://api.github.com/users/lzang/events{/privacy}","received_events_url":"https://api.github.com/users/lzang/received_events","type":"User","site_admin":false},"html_url":"https://github.com/lzang/netd","description":null,"fork":true,"url":"https://api.github.com/repos/lzang/netd","forks_url":"https://api.github.com/repos/lzang/netd/forks","keys_url":"https://api.github.com/repos/lzang/netd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lzang/netd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lzang/netd/teams","hooks_url":"https://api.github.com/repos/lzang/netd/hooks","issue_events_url":"https://api.github.com/repos/lzang/netd/issues/events{/number}","events_url":"https://api.github.com/repos/lzang/netd/events","assignees_url":"https://api.github.com/repos/lzang/netd/assignees{/user}","branches_url":"https://api.github.com/repos/lzang/netd/branches{/branch}","tags_url":"https://api.github.com/repos/lzang/netd/tags","blobs_url":"https://api.github.com/repos/lzang/netd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lzang/netd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lzang/netd/git/refs{/sha}","trees_url":"https://api.github.com/repos/lzang/netd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lzang/netd/statuses/{sha}","languages_url":"https://api.github.com/repos/lzang/netd/languages","stargazers_url":"https://api.github.com/repos/lzang/netd/stargazers","contributors_url":"https://api.github.com/repos/lzang/netd/contributors","subscribers_url":"https://api.github.com/repos/lzang/netd/subscribers","subscription_url":"https://api.github.com/repos/lzang/netd/subscription","commits_url":"https://api.github.com/repos/lzang/netd/commits{/sha}","git_commits_url":"https://api.github.com/repos/lzang/netd/git/commits{/sha}","comments_url":"https://api.github.com/repos/lzang/netd/comments{/number}","issue_comment_url":"https://api.github.com/repos/lzang/netd/issues/comments{/number}","contents_url":"https://api.github.com/repos/lzang/netd/contents/{+path}","compare_url":"https://api.github.com/repos/lzang/netd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lzang/netd/merges","archive_url":"https://api.github.com/repos/lzang/netd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lzang/netd/downloads","issues_url":"https://api.github.com/repos/lzang/netd/issues{/number}","pulls_url":"https://api.github.com/repos/lzang/netd/pulls{/number}","milestones_url":"https://api.github.com/repos/lzang/netd/milestones{/number}","notifications_url":"https://api.github.com/repos/lzang/netd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lzang/netd/labels{/name}","releases_url":"https://api.github.com/repos/lzang/netd/releases{/id}","deployments_url":"https://api.github.com/repos/lzang/netd/deployments","created_at":"2018-10-12T20:50:52Z","updated_at":"2018-10-25T16:32:40Z","pushed_at":"2018-11-20T18:25:58Z","git_url":"git://github.com/lzang/netd.git","ssh_url":"git@github.com:lzang/netd.git","clone_url":"https://github.com/lzang/netd.git","svn_url":"https://github.com/lzang/netd","homepage":null,"size":4728,"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":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"50d03eec4b42302c203e11b372d186fb1b171961","user":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":133570801,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM1NzA4MDE=","name":"netd","full_name":"GoogleCloudPlatform/netd","private":false,"owner":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GoogleCloudPlatform/netd","description":"netd: GKE Networking Daemonset","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/netd","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/netd/deployments","created_at":"2018-05-15T20:39:32Z","updated_at":"2018-11-20T22:13:08Z","pushed_at":"2018-11-20T18:26:02Z","git_url":"git://github.com/GoogleCloudPlatform/netd.git","ssh_url":"git@github.com:GoogleCloudPlatform/netd.git","clone_url":"https://github.com/GoogleCloudPlatform/netd.git","svn_url":"https://github.com/GoogleCloudPlatform/netd","homepage":"","size":4546,"stargazers_count":9,"watchers_count":9,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"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","node_id":"MDc6TGljZW5zZTI="},"forks":8,"open_issues":3,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/50"},"html":{"href":"https://github.com/GoogleCloudPlatform/netd/pull/50"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/issues/50"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/netd/statuses/ea995abfbe88b46e4595702ef0123b9b7b1a817a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"bowei"}}