{"action":"created","comment":{"url":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/comments/47575292","id":47575292,"diff_hunk":"@@ -265,9 +290,80 @@ func nameToLabel(name string) map[string]string {\n \treturn extraLabels\n }\n \n-func (p *prometheusScraper) main(paramDataSendRate time.Duration) (err error) {\n+func updateNodes(cPort int) (hostIPtoNodeMap map[string]kubeAPI.Node, nodeIPs []string) {\n+\tfmt.Printf(\"Updating Nodes\\n\")\n+\tkubeClient, kubeErr := kube.NewInCluster()\n+\tif kubeErr != nil {\n+\t\tfmt.Printf(\"kubeErr: %v\\n\", kubeErr)\n+\t\treturn nil, nil\n+\t}\n+\n+\tfmt.Printf(\"kubeClient created.\\n\")\n+\thostIPtoNodeMap = make(map[string]kubeAPI.Node, 2)\n+\tnodeIPs = make([]string, 0, 2)\n+\tnodeList, apiErr := kubeClient.Nodes().List(kubeLabels.Everything(), kubeFields.Everything())\n+\tif apiErr != nil {\n+\t\tfmt.Printf(\"apiErr: %v\\n\", apiErr)\n+\t} else {\n+\t\tfmt.Printf(\"nodeList received.\\n\")\n+\t\tfor _, node := range nodeList.Items {\n+\t\t\tvar hostIP string\n+\t\t\tfor _, nodeAddress := range node.Status.Addresses {\n+\t\t\t\tswitch nodeAddress.Type {\n+\t\t\t\tcase kubeAPI.NodeInternalIP:\n+\t\t\t\t\thostIP = nodeAddress.Address\n+\t\t\t\t\tbreak\n+\t\t\t\tcase kubeAPI.NodeLegacyHostIP:\n+\t\t\t\t\thostIP = nodeAddress.Address\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif hostIP != \"\" {\n+\t\t\t\thostIP = fmt.Sprintf(\"http://%v:%v\", hostIP, cPort)\n+\t\t\t\tnodeIPs = append(nodeIPs, hostIP)\n+\t\t\t\thostIPtoNodeMap[hostIP] = node\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn hostIPtoNodeMap, nodeIPs\n+}\n+\n+func updateServices() (podToServiceMap map[string]string) {\n+\tfmt.Printf(\"Updating Services\\n\")","path":"cmd/prometheustosfx/main.go","position":211,"original_position":211,"commit_id":"473d1492e0a9015a44bcb56dac0533f4c065380f","original_commit_id":"473d1492e0a9015a44bcb56dac0533f4c065380f","user":{"login":"cep21","id":20358,"avatar_url":"https://avatars.githubusercontent.com/u/20358?v=3","gravatar_id":"","url":"https://api.github.com/users/cep21","html_url":"https://github.com/cep21","followers_url":"https://api.github.com/users/cep21/followers","following_url":"https://api.github.com/users/cep21/following{/other_user}","gists_url":"https://api.github.com/users/cep21/gists{/gist_id}","starred_url":"https://api.github.com/users/cep21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cep21/subscriptions","organizations_url":"https://api.github.com/users/cep21/orgs","repos_url":"https://api.github.com/users/cep21/repos","events_url":"https://api.github.com/users/cep21/events{/privacy}","received_events_url":"https://api.github.com/users/cep21/received_events","type":"User","site_admin":false},"body":"Maybe use fmt.Println()?","created_at":"2015-12-14T23:23:28Z","updated_at":"2015-12-14T23:23:28Z","html_url":"https://github.com/signalfx/cadvisor-integration/pull/1#discussion_r47575292","pull_request_url":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/comments/47575292"},"html":{"href":"https://github.com/signalfx/cadvisor-integration/pull/1#discussion_r47575292"},"pull_request":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/1","id":53182361,"html_url":"https://github.com/signalfx/cadvisor-integration/pull/1","diff_url":"https://github.com/signalfx/cadvisor-integration/pull/1.diff","patch_url":"https://github.com/signalfx/cadvisor-integration/pull/1.patch","issue_url":"https://api.github.com/repos/signalfx/cadvisor-integration/issues/1","number":1,"state":"open","locked":false,"title":"New dimensions and readme update.","user":{"login":"BitBuster","id":5023566,"avatar_url":"https://avatars.githubusercontent.com/u/5023566?v=3","gravatar_id":"","url":"https://api.github.com/users/BitBuster","html_url":"https://github.com/BitBuster","followers_url":"https://api.github.com/users/BitBuster/followers","following_url":"https://api.github.com/users/BitBuster/following{/other_user}","gists_url":"https://api.github.com/users/BitBuster/gists{/gist_id}","starred_url":"https://api.github.com/users/BitBuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BitBuster/subscriptions","organizations_url":"https://api.github.com/users/BitBuster/orgs","repos_url":"https://api.github.com/users/BitBuster/repos","events_url":"https://api.github.com/users/BitBuster/events{/privacy}","received_events_url":"https://api.github.com/users/BitBuster/received_events","type":"User","site_admin":false},"body":"@cep21 Please review changes:\r\n* Added nodes discovery. New dimensions: node, service, cluster.\r\n* Extracted code to updateNodes and updateServices functions\r\n* Nodes and services re-discovery.\r\n* Removed cadvisor_version_info metric. Added new dimensions: node_container_runtime_version, node_kernel_version, node_kubelet_version, node_os_image, node_kubeproxy_version\r\n* Added cAdvisor port to configuration.\r\n* Readme update","created_at":"2015-12-09T21:44:14Z","updated_at":"2015-12-14T23:23:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21d7f305f0b5e6973c57e17c466396c4be55143d","assignee":{"login":"cep21","id":20358,"avatar_url":"https://avatars.githubusercontent.com/u/20358?v=3","gravatar_id":"","url":"https://api.github.com/users/cep21","html_url":"https://github.com/cep21","followers_url":"https://api.github.com/users/cep21/followers","following_url":"https://api.github.com/users/cep21/following{/other_user}","gists_url":"https://api.github.com/users/cep21/gists{/gist_id}","starred_url":"https://api.github.com/users/cep21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cep21/subscriptions","organizations_url":"https://api.github.com/users/cep21/orgs","repos_url":"https://api.github.com/users/cep21/repos","events_url":"https://api.github.com/users/cep21/events{/privacy}","received_events_url":"https://api.github.com/users/cep21/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/1/commits","review_comments_url":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/1/comments","review_comment_url":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/signalfx/cadvisor-integration/issues/1/comments","statuses_url":"https://api.github.com/repos/signalfx/cadvisor-integration/statuses/473d1492e0a9015a44bcb56dac0533f4c065380f","head":{"label":"signalfx:new_dim_squashed","ref":"new_dim_squashed","sha":"473d1492e0a9015a44bcb56dac0533f4c065380f","user":{"login":"signalfx","id":8184587,"avatar_url":"https://avatars.githubusercontent.com/u/8184587?v=3","gravatar_id":"","url":"https://api.github.com/users/signalfx","html_url":"https://github.com/signalfx","followers_url":"https://api.github.com/users/signalfx/followers","following_url":"https://api.github.com/users/signalfx/following{/other_user}","gists_url":"https://api.github.com/users/signalfx/gists{/gist_id}","starred_url":"https://api.github.com/users/signalfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalfx/subscriptions","organizations_url":"https://api.github.com/users/signalfx/orgs","repos_url":"https://api.github.com/users/signalfx/repos","events_url":"https://api.github.com/users/signalfx/events{/privacy}","received_events_url":"https://api.github.com/users/signalfx/received_events","type":"Organization","site_admin":false},"repo":{"id":44644716,"name":"cadvisor-integration","full_name":"signalfx/cadvisor-integration","owner":{"login":"signalfx","id":8184587,"avatar_url":"https://avatars.githubusercontent.com/u/8184587?v=3","gravatar_id":"","url":"https://api.github.com/users/signalfx","html_url":"https://github.com/signalfx","followers_url":"https://api.github.com/users/signalfx/followers","following_url":"https://api.github.com/users/signalfx/following{/other_user}","gists_url":"https://api.github.com/users/signalfx/gists{/gist_id}","starred_url":"https://api.github.com/users/signalfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalfx/subscriptions","organizations_url":"https://api.github.com/users/signalfx/orgs","repos_url":"https://api.github.com/users/signalfx/repos","events_url":"https://api.github.com/users/signalfx/events{/privacy}","received_events_url":"https://api.github.com/users/signalfx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalfx/cadvisor-integration","description":"Scrape prometheus endpoints for metrics","fork":false,"url":"https://api.github.com/repos/signalfx/cadvisor-integration","forks_url":"https://api.github.com/repos/signalfx/cadvisor-integration/forks","keys_url":"https://api.github.com/repos/signalfx/cadvisor-integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalfx/cadvisor-integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalfx/cadvisor-integration/teams","hooks_url":"https://api.github.com/repos/signalfx/cadvisor-integration/hooks","issue_events_url":"https://api.github.com/repos/signalfx/cadvisor-integration/issues/events{/number}","events_url":"https://api.github.com/repos/signalfx/cadvisor-integration/events","assignees_url":"https://api.github.com/repos/signalfx/cadvisor-integration/assignees{/user}","branches_url":"https://api.github.com/repos/signalfx/cadvisor-integration/branches{/branch}","tags_url":"https://api.github.com/repos/signalfx/cadvisor-integration/tags","blobs_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalfx/cadvisor-integration/statuses/{sha}","languages_url":"https://api.github.com/repos/signalfx/cadvisor-integration/languages","stargazers_url":"https://api.github.com/repos/signalfx/cadvisor-integration/stargazers","contributors_url":"https://api.github.com/repos/signalfx/cadvisor-integration/contributors","subscribers_url":"https://api.github.com/repos/signalfx/cadvisor-integration/subscribers","subscription_url":"https://api.github.com/repos/signalfx/cadvisor-integration/subscription","commits_url":"https://api.github.com/repos/signalfx/cadvisor-integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalfx/cadvisor-integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalfx/cadvisor-integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/signalfx/cadvisor-integration/contents/{+path}","compare_url":"https://api.github.com/repos/signalfx/cadvisor-integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalfx/cadvisor-integration/merges","archive_url":"https://api.github.com/repos/signalfx/cadvisor-integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalfx/cadvisor-integration/downloads","issues_url":"https://api.github.com/repos/signalfx/cadvisor-integration/issues{/number}","pulls_url":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls{/number}","milestones_url":"https://api.github.com/repos/signalfx/cadvisor-integration/milestones{/number}","notifications_url":"https://api.github.com/repos/signalfx/cadvisor-integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalfx/cadvisor-integration/labels{/name}","releases_url":"https://api.github.com/repos/signalfx/cadvisor-integration/releases{/id}","created_at":"2015-10-21T01:18:16Z","updated_at":"2015-12-07T23:53:36Z","pushed_at":"2015-12-09T22:46:58Z","git_url":"git://github.com/signalfx/cadvisor-integration.git","ssh_url":"git@github.com:signalfx/cadvisor-integration.git","clone_url":"https://github.com/signalfx/cadvisor-integration.git","svn_url":"https://github.com/signalfx/cadvisor-integration","homepage":null,"size":1474,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"signalfx:master","ref":"master","sha":"4b83cde49c6e2bc1e8f72753100c42a53f1af78b","user":{"login":"signalfx","id":8184587,"avatar_url":"https://avatars.githubusercontent.com/u/8184587?v=3","gravatar_id":"","url":"https://api.github.com/users/signalfx","html_url":"https://github.com/signalfx","followers_url":"https://api.github.com/users/signalfx/followers","following_url":"https://api.github.com/users/signalfx/following{/other_user}","gists_url":"https://api.github.com/users/signalfx/gists{/gist_id}","starred_url":"https://api.github.com/users/signalfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalfx/subscriptions","organizations_url":"https://api.github.com/users/signalfx/orgs","repos_url":"https://api.github.com/users/signalfx/repos","events_url":"https://api.github.com/users/signalfx/events{/privacy}","received_events_url":"https://api.github.com/users/signalfx/received_events","type":"Organization","site_admin":false},"repo":{"id":44644716,"name":"cadvisor-integration","full_name":"signalfx/cadvisor-integration","owner":{"login":"signalfx","id":8184587,"avatar_url":"https://avatars.githubusercontent.com/u/8184587?v=3","gravatar_id":"","url":"https://api.github.com/users/signalfx","html_url":"https://github.com/signalfx","followers_url":"https://api.github.com/users/signalfx/followers","following_url":"https://api.github.com/users/signalfx/following{/other_user}","gists_url":"https://api.github.com/users/signalfx/gists{/gist_id}","starred_url":"https://api.github.com/users/signalfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalfx/subscriptions","organizations_url":"https://api.github.com/users/signalfx/orgs","repos_url":"https://api.github.com/users/signalfx/repos","events_url":"https://api.github.com/users/signalfx/events{/privacy}","received_events_url":"https://api.github.com/users/signalfx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalfx/cadvisor-integration","description":"Scrape prometheus endpoints for metrics","fork":false,"url":"https://api.github.com/repos/signalfx/cadvisor-integration","forks_url":"https://api.github.com/repos/signalfx/cadvisor-integration/forks","keys_url":"https://api.github.com/repos/signalfx/cadvisor-integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalfx/cadvisor-integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalfx/cadvisor-integration/teams","hooks_url":"https://api.github.com/repos/signalfx/cadvisor-integration/hooks","issue_events_url":"https://api.github.com/repos/signalfx/cadvisor-integration/issues/events{/number}","events_url":"https://api.github.com/repos/signalfx/cadvisor-integration/events","assignees_url":"https://api.github.com/repos/signalfx/cadvisor-integration/assignees{/user}","branches_url":"https://api.github.com/repos/signalfx/cadvisor-integration/branches{/branch}","tags_url":"https://api.github.com/repos/signalfx/cadvisor-integration/tags","blobs_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalfx/cadvisor-integration/statuses/{sha}","languages_url":"https://api.github.com/repos/signalfx/cadvisor-integration/languages","stargazers_url":"https://api.github.com/repos/signalfx/cadvisor-integration/stargazers","contributors_url":"https://api.github.com/repos/signalfx/cadvisor-integration/contributors","subscribers_url":"https://api.github.com/repos/signalfx/cadvisor-integration/subscribers","subscription_url":"https://api.github.com/repos/signalfx/cadvisor-integration/subscription","commits_url":"https://api.github.com/repos/signalfx/cadvisor-integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalfx/cadvisor-integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalfx/cadvisor-integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalfx/cadvisor-integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/signalfx/cadvisor-integration/contents/{+path}","compare_url":"https://api.github.com/repos/signalfx/cadvisor-integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalfx/cadvisor-integration/merges","archive_url":"https://api.github.com/repos/signalfx/cadvisor-integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalfx/cadvisor-integration/downloads","issues_url":"https://api.github.com/repos/signalfx/cadvisor-integration/issues{/number}","pulls_url":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls{/number}","milestones_url":"https://api.github.com/repos/signalfx/cadvisor-integration/milestones{/number}","notifications_url":"https://api.github.com/repos/signalfx/cadvisor-integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalfx/cadvisor-integration/labels{/name}","releases_url":"https://api.github.com/repos/signalfx/cadvisor-integration/releases{/id}","created_at":"2015-10-21T01:18:16Z","updated_at":"2015-12-07T23:53:36Z","pushed_at":"2015-12-09T22:46:58Z","git_url":"git://github.com/signalfx/cadvisor-integration.git","ssh_url":"git@github.com:signalfx/cadvisor-integration.git","clone_url":"https://github.com/signalfx/cadvisor-integration.git","svn_url":"https://github.com/signalfx/cadvisor-integration","homepage":null,"size":1474,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/1"},"html":{"href":"https://github.com/signalfx/cadvisor-integration/pull/1"},"issue":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/issues/1"},"comments":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/signalfx/cadvisor-integration/statuses/473d1492e0a9015a44bcb56dac0533f4c065380f"}}}}