{"action":"created","comment":{"url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/comments/194036765","pull_request_review_id":127135707,"id":194036765,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDAzNjc2NQ==","diff_hunk":"@@ -19,8 +19,21 @@ def _get_sysctl_metrics(self):\n         sysctl = sp.Popen(['cat', '/proc/sys/net/netfilter/nf_conntrack_count',\n                            '/proc/sys/net/netfilter/nf_conntrack_max'],\n                           stdout=sp.PIPE, close_fds=True).communicate()[0]\n-        lines = sysctl.split('\\n')\n+        sysctl_lines = sysctl.split('\\n')\n         conntrack_info = {}\n-        conntrack_info['conntrack_count'] = lines[0]\n-        conntrack_info['conntrack_max'] = lines[1]\n+        conntrack_info['conntrack_count'] = sysctl_lines[0]\n+        conntrack_info['conntrack_max'] = sysctl_lines[1]\n+\n+        conntrack = sp.Popen(['conntrack', '-S'],\n+                          stdout=sp.PIPE, close_fds=True).communicate()[0]\n+        conntrack_lines = conntrack.split('\\n')\n+        regexp = re.compile(r'^(\\w+)\\s+([0-9]+)')\n+        for line in conntrack_lines:\n+            try:\n+                match = re.search(regexp, line)\n+                if match is not None:\n+                    conntrack_info['conntrack_{}'.format(match.group(1))] = match.group(2)","path":"checks.d/conntrack.py","position":20,"original_position":20,"commit_id":"1ea438f835ea73d1d0d692962cdd4e833d63bf52","original_commit_id":"bd35493af56390c265de1c70ef16182e6f3a4202","user":{"login":"indrekj","id":3438,"node_id":"MDQ6VXNlcjM0Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3438?v=4","gravatar_id":"","url":"https://api.github.com/users/indrekj","html_url":"https://github.com/indrekj","followers_url":"https://api.github.com/users/indrekj/followers","following_url":"https://api.github.com/users/indrekj/following{/other_user}","gists_url":"https://api.github.com/users/indrekj/gists{/gist_id}","starred_url":"https://api.github.com/users/indrekj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indrekj/subscriptions","organizations_url":"https://api.github.com/users/indrekj/orgs","repos_url":"https://api.github.com/users/indrekj/repos","events_url":"https://api.github.com/users/indrekj/events{/privacy}","received_events_url":"https://api.github.com/users/indrekj/received_events","type":"User","site_admin":false},"body":"conntrack -S from coreos returns:\r\n```\r\ncpu=0   \tfound=82340 invalid=2053326 ignore=13151065 insert=0 insert_failed=2589 drop=2589 early_drop=0 error=0 search_restart=17585788\r\ncpu=1   \tfound=3595 invalid=743347 ignore=13986563 insert=0 insert_failed=1343 drop=1343 early_drop=0 error=0 search_restart=2358020\r\ncpu=2   \tfound=2741 invalid=694264 ignore=13699278 insert=0 insert_failed=1566 drop=1566 early_drop=0 error=0 search_restart=2247355\r\ncpu=3   \tfound=2856 invalid=674020 ignore=14061149 insert=0 insert_failed=1067 drop=1067 early_drop=0 error=0 search_restart=2200985\r\n...\r\n```\r\nDo I understand correctly that you're currently overwriting the values. I think it should SUM() the keys.","created_at":"2018-06-08T12:08:09Z","updated_at":"2018-06-08T12:08:10Z","html_url":"https://github.com/salemove/sm-docker-dd-agent/pull/16#discussion_r194036765","pull_request_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/16","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/comments/194036765"},"html":{"href":"https://github.com/salemove/sm-docker-dd-agent/pull/16#discussion_r194036765"},"pull_request":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/16","id":193593199,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNTkzMTk5","html_url":"https://github.com/salemove/sm-docker-dd-agent/pull/16","diff_url":"https://github.com/salemove/sm-docker-dd-agent/pull/16.diff","patch_url":"https://github.com/salemove/sm-docker-dd-agent/pull/16.patch","issue_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues/16","number":16,"state":"open","locked":false,"title":"Add conntrack_insert_failed metrics to Datadog","user":{"login":"ostankin","id":14212497,"node_id":"MDQ6VXNlcjE0MjEyNDk3","avatar_url":"https://avatars1.githubusercontent.com/u/14212497?v=4","gravatar_id":"","url":"https://api.github.com/users/ostankin","html_url":"https://github.com/ostankin","followers_url":"https://api.github.com/users/ostankin/followers","following_url":"https://api.github.com/users/ostankin/following{/other_user}","gists_url":"https://api.github.com/users/ostankin/gists{/gist_id}","starred_url":"https://api.github.com/users/ostankin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostankin/subscriptions","organizations_url":"https://api.github.com/users/ostankin/orgs","repos_url":"https://api.github.com/users/ostankin/repos","events_url":"https://api.github.com/users/ostankin/events{/privacy}","received_events_url":"https://api.github.com/users/ostankin/received_events","type":"User","site_admin":false},"body":"INF-1688\r\n\r\nIn fact, this change also adds the whole output of `conntrack -S` command, such as conntrack_drop, conntrack_icmp_error, etc. Here is an example output:\r\n```\r\n{'conntrack_expect_new': '0', 'conntrack_entries': '6900', 'conntrack_icmp_error': '1', 'conntrack_delete_list': '0', 'conntrack_count': '6906', 'conntrack_delete': '0', 'conntrack_new': '0', 'conntrack_search_restart': '32915922', 'conntrack_searched': '0', 'conntrack_insert_failed': '12783', 'conntrack_expect_delete': '0', 'conntrack_max': '524288', 'conntrack_invalid': '3828268', 'conntrack_expect_create': '0', 'conntrack_ignore': '13994012', 'conntrack_found': '72550', 'conntrack_early_drop': '0', 'conntrack_insert': '0', 'conntrack_drop': '12783'}\r\n```","created_at":"2018-06-08T12:01:55Z","updated_at":"2018-06-08T12:08:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2645b81a369dd8a1ca5ff7bf4e7b2623f93113d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/16/commits","review_comments_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/16/comments","review_comment_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues/16/comments","statuses_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/statuses/1ea438f835ea73d1d0d692962cdd4e833d63bf52","head":{"label":"salemove:INF-1688_add_conntrack_insert_failed_metrics","ref":"INF-1688_add_conntrack_insert_failed_metrics","sha":"1ea438f835ea73d1d0d692962cdd4e833d63bf52","user":{"login":"salemove","id":5281619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODE2MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/5281619?v=4","gravatar_id":"","url":"https://api.github.com/users/salemove","html_url":"https://github.com/salemove","followers_url":"https://api.github.com/users/salemove/followers","following_url":"https://api.github.com/users/salemove/following{/other_user}","gists_url":"https://api.github.com/users/salemove/gists{/gist_id}","starred_url":"https://api.github.com/users/salemove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salemove/subscriptions","organizations_url":"https://api.github.com/users/salemove/orgs","repos_url":"https://api.github.com/users/salemove/repos","events_url":"https://api.github.com/users/salemove/events{/privacy}","received_events_url":"https://api.github.com/users/salemove/received_events","type":"Organization","site_admin":false},"repo":{"id":67030702,"node_id":"MDEwOlJlcG9zaXRvcnk2NzAzMDcwMg==","name":"sm-docker-dd-agent","full_name":"salemove/sm-docker-dd-agent","owner":{"login":"salemove","id":5281619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODE2MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/5281619?v=4","gravatar_id":"","url":"https://api.github.com/users/salemove","html_url":"https://github.com/salemove","followers_url":"https://api.github.com/users/salemove/followers","following_url":"https://api.github.com/users/salemove/following{/other_user}","gists_url":"https://api.github.com/users/salemove/gists{/gist_id}","starred_url":"https://api.github.com/users/salemove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salemove/subscriptions","organizations_url":"https://api.github.com/users/salemove/orgs","repos_url":"https://api.github.com/users/salemove/repos","events_url":"https://api.github.com/users/salemove/events{/privacy}","received_events_url":"https://api.github.com/users/salemove/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/salemove/sm-docker-dd-agent","description":null,"fork":false,"url":"https://api.github.com/repos/salemove/sm-docker-dd-agent","forks_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/forks","keys_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/teams","hooks_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/hooks","issue_events_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/events","assignees_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/tags","blobs_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/languages","stargazers_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/stargazers","contributors_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/contributors","subscribers_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/subscribers","subscription_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/subscription","commits_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/merges","archive_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/downloads","issues_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/releases{/id}","deployments_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/deployments","created_at":"2016-08-31T11:17:51Z","updated_at":"2018-06-07T14:25:00Z","pushed_at":"2018-06-08T12:03:48Z","git_url":"git://github.com/salemove/sm-docker-dd-agent.git","ssh_url":"git@github.com:salemove/sm-docker-dd-agent.git","clone_url":"https://github.com/salemove/sm-docker-dd-agent.git","svn_url":"https://github.com/salemove/sm-docker-dd-agent","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"salemove:master","ref":"master","sha":"529aadd80f5f227c5cf9fad74a689a280fea6e41","user":{"login":"salemove","id":5281619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODE2MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/5281619?v=4","gravatar_id":"","url":"https://api.github.com/users/salemove","html_url":"https://github.com/salemove","followers_url":"https://api.github.com/users/salemove/followers","following_url":"https://api.github.com/users/salemove/following{/other_user}","gists_url":"https://api.github.com/users/salemove/gists{/gist_id}","starred_url":"https://api.github.com/users/salemove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salemove/subscriptions","organizations_url":"https://api.github.com/users/salemove/orgs","repos_url":"https://api.github.com/users/salemove/repos","events_url":"https://api.github.com/users/salemove/events{/privacy}","received_events_url":"https://api.github.com/users/salemove/received_events","type":"Organization","site_admin":false},"repo":{"id":67030702,"node_id":"MDEwOlJlcG9zaXRvcnk2NzAzMDcwMg==","name":"sm-docker-dd-agent","full_name":"salemove/sm-docker-dd-agent","owner":{"login":"salemove","id":5281619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODE2MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/5281619?v=4","gravatar_id":"","url":"https://api.github.com/users/salemove","html_url":"https://github.com/salemove","followers_url":"https://api.github.com/users/salemove/followers","following_url":"https://api.github.com/users/salemove/following{/other_user}","gists_url":"https://api.github.com/users/salemove/gists{/gist_id}","starred_url":"https://api.github.com/users/salemove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salemove/subscriptions","organizations_url":"https://api.github.com/users/salemove/orgs","repos_url":"https://api.github.com/users/salemove/repos","events_url":"https://api.github.com/users/salemove/events{/privacy}","received_events_url":"https://api.github.com/users/salemove/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/salemove/sm-docker-dd-agent","description":null,"fork":false,"url":"https://api.github.com/repos/salemove/sm-docker-dd-agent","forks_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/forks","keys_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/teams","hooks_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/hooks","issue_events_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/events","assignees_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/tags","blobs_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/languages","stargazers_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/stargazers","contributors_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/contributors","subscribers_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/subscribers","subscription_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/subscription","commits_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/merges","archive_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/downloads","issues_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/releases{/id}","deployments_url":"https://api.github.com/repos/salemove/sm-docker-dd-agent/deployments","created_at":"2016-08-31T11:17:51Z","updated_at":"2018-06-07T14:25:00Z","pushed_at":"2018-06-08T12:03:48Z","git_url":"git://github.com/salemove/sm-docker-dd-agent.git","ssh_url":"git@github.com:salemove/sm-docker-dd-agent.git","clone_url":"https://github.com/salemove/sm-docker-dd-agent.git","svn_url":"https://github.com/salemove/sm-docker-dd-agent","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/16"},"html":{"href":"https://github.com/salemove/sm-docker-dd-agent/pull/16"},"issue":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues/16"},"comments":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/salemove/sm-docker-dd-agent/statuses/1ea438f835ea73d1d0d692962cdd4e833d63bf52"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"indrekj"}}