{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments/93424831","pull_request_review_id":13951154,"id":93424831,"diff_hunk":"@@ -351,6 +372,27 @@ func (c *hwMonCollector) hwmonName(dir string) (string, error) {\n \treturn \"\", errors.New(\"Could not derive a monitoring name for \" + dir)\n }\n \n+func (c *hwMonCollector) hwmonHumanReadableChipName(dir string) (string, error) {\n+\t// this is similar to the methods in hwmonName, but with different","path":"collector/hwmon_linux.go","position":40,"original_position":40,"commit_id":"3efaa1a6a89ad2d381b5d70ebb9fb69d198b4f49","original_commit_id":"3efaa1a6a89ad2d381b5d70ebb9fb69d198b4f49","user":{"login":"discordianfish","id":275966,"avatar_url":"https://avatars.githubusercontent.com/u/275966?v=3","gravatar_id":"","url":"https://api.github.com/users/discordianfish","html_url":"https://github.com/discordianfish","followers_url":"https://api.github.com/users/discordianfish/followers","following_url":"https://api.github.com/users/discordianfish/following{/other_user}","gists_url":"https://api.github.com/users/discordianfish/gists{/gist_id}","starred_url":"https://api.github.com/users/discordianfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discordianfish/subscriptions","organizations_url":"https://api.github.com/users/discordianfish/orgs","repos_url":"https://api.github.com/users/discordianfish/repos","events_url":"https://api.github.com/users/discordianfish/events{/privacy}","received_events_url":"https://api.github.com/users/discordianfish/received_events","type":"User","site_admin":false},"body":"Can you move this above the function and start with \"hwmonHumanReadableChipName is similar to ....\"?","created_at":"2016-12-21T11:54:58Z","updated_at":"2016-12-21T11:55:50Z","html_url":"https://github.com/prometheus/node_exporter/pull/359#discussion_r93424831","pull_request_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/359","_links":{"self":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments/93424831"},"html":{"href":"https://github.com/prometheus/node_exporter/pull/359#discussion_r93424831"},"pull_request":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/359"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/node_exporter/pulls/359","id":95669968,"html_url":"https://github.com/prometheus/node_exporter/pull/359","diff_url":"https://github.com/prometheus/node_exporter/pull/359.diff","patch_url":"https://github.com/prometheus/node_exporter/pull/359.patch","issue_url":"https://api.github.com/repos/prometheus/node_exporter/issues/359","number":359,"state":"open","locked":false,"title":"hwmon: Provide annotation metric to link chip sysfs paths to human-readable chip types","user":{"login":"horazont","id":271710,"avatar_url":"https://avatars.githubusercontent.com/u/271710?v=3","gravatar_id":"","url":"https://api.github.com/users/horazont","html_url":"https://github.com/horazont","followers_url":"https://api.github.com/users/horazont/followers","following_url":"https://api.github.com/users/horazont/following{/other_user}","gists_url":"https://api.github.com/users/horazont/gists{/gist_id}","starred_url":"https://api.github.com/users/horazont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/horazont/subscriptions","organizations_url":"https://api.github.com/users/horazont/orgs","repos_url":"https://api.github.com/users/horazont/repos","events_url":"https://api.github.com/users/horazont/events{/privacy}","received_events_url":"https://api.github.com/users/horazont/received_events","type":"User","site_admin":false},"body":"The chip label generation has been changed in #334 to prefer the unique device path (e.g. the location on the PCI bus) due to #333.\r\n\r\nAfter discussion in #355, we learnt that the way forward is to provide an annotation metric (instead of a new label on the existing metrics). The annotation metric allows to link the unique chip sysfs path to a human-readable chip type which may not be unique among chip sysfs paths (for example, dual-slot systems have multiple chipType=\"coretemp\" sensors).\r\n\r\nThis allows to mitigate the downsides of the solution to #333 (namely that the device path may not be stable across kernels and reboots) for cases where it does not matter that multiple devices may have the same human-readable type (e.g. aggregation or where at most one device of a type is present).\r\n\r\nFor cases where no human-readable type can be derived, the annotation metric is not emitted.\r\n\r\n(**Note:** The below examples have been modified to match the most recent commits in this pull request.)\r\n\r\nThe annotation metric can be used in queries like this:\r\n\r\n1. Find the voltages of a nouveau-driven GPU:\r\n\r\n        node_hwmon_in_volts and on (chip) node_hwmon_chip_names{chip_name=\"nouveau\"}\r\n\r\n2. Find the temperatures of a GPU using the amdgpu driver:\r\n\r\n        node_hwmon_temp_celsius and on (chip) node_hwmon_chip_names{chip_name=\"amdgpu\"}\r\n\r\n3. Find all CPU temperatures:\r\n\r\n        node_hwmon_temp_celsius and on (chip) node_hwmon_chip_names{chip_name=\"coretemp\"}","created_at":"2016-11-29T11:02:47Z","updated_at":"2016-12-21T11:55:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df4f346371d2b01ee823661fdce9554cf928b770","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/359/commits","review_comments_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/359/comments","review_comment_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prometheus/node_exporter/issues/359/comments","statuses_url":"https://api.github.com/repos/prometheus/node_exporter/statuses/3efaa1a6a89ad2d381b5d70ebb9fb69d198b4f49","head":{"label":"CloudAndHeat:feature/hwmon_chip_name_metric","ref":"feature/hwmon_chip_name_metric","sha":"3efaa1a6a89ad2d381b5d70ebb9fb69d198b4f49","user":{"login":"CloudAndHeat","id":13366253,"avatar_url":"https://avatars.githubusercontent.com/u/13366253?v=3","gravatar_id":"","url":"https://api.github.com/users/CloudAndHeat","html_url":"https://github.com/CloudAndHeat","followers_url":"https://api.github.com/users/CloudAndHeat/followers","following_url":"https://api.github.com/users/CloudAndHeat/following{/other_user}","gists_url":"https://api.github.com/users/CloudAndHeat/gists{/gist_id}","starred_url":"https://api.github.com/users/CloudAndHeat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CloudAndHeat/subscriptions","organizations_url":"https://api.github.com/users/CloudAndHeat/orgs","repos_url":"https://api.github.com/users/CloudAndHeat/repos","events_url":"https://api.github.com/users/CloudAndHeat/events{/privacy}","received_events_url":"https://api.github.com/users/CloudAndHeat/received_events","type":"Organization","site_admin":false},"repo":{"id":74970180,"name":"node_exporter","full_name":"CloudAndHeat/node_exporter","owner":{"login":"CloudAndHeat","id":13366253,"avatar_url":"https://avatars.githubusercontent.com/u/13366253?v=3","gravatar_id":"","url":"https://api.github.com/users/CloudAndHeat","html_url":"https://github.com/CloudAndHeat","followers_url":"https://api.github.com/users/CloudAndHeat/followers","following_url":"https://api.github.com/users/CloudAndHeat/following{/other_user}","gists_url":"https://api.github.com/users/CloudAndHeat/gists{/gist_id}","starred_url":"https://api.github.com/users/CloudAndHeat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CloudAndHeat/subscriptions","organizations_url":"https://api.github.com/users/CloudAndHeat/orgs","repos_url":"https://api.github.com/users/CloudAndHeat/repos","events_url":"https://api.github.com/users/CloudAndHeat/events{/privacy}","received_events_url":"https://api.github.com/users/CloudAndHeat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CloudAndHeat/node_exporter","description":"Exporter for machine metrics","fork":true,"url":"https://api.github.com/repos/CloudAndHeat/node_exporter","forks_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/forks","keys_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/teams","hooks_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/hooks","issue_events_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/issues/events{/number}","events_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/events","assignees_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/assignees{/user}","branches_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/branches{/branch}","tags_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/tags","blobs_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/languages","stargazers_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/stargazers","contributors_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/contributors","subscribers_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/subscribers","subscription_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/subscription","commits_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/contents/{+path}","compare_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/merges","archive_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/downloads","issues_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/issues{/number}","pulls_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/labels{/name}","releases_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/releases{/id}","deployments_url":"https://api.github.com/repos/CloudAndHeat/node_exporter/deployments","created_at":"2016-11-28T12:18:48Z","updated_at":"2016-11-28T12:18:51Z","pushed_at":"2016-12-01T09:01:23Z","git_url":"git://github.com/CloudAndHeat/node_exporter.git","ssh_url":"git@github.com:CloudAndHeat/node_exporter.git","clone_url":"https://github.com/CloudAndHeat/node_exporter.git","svn_url":"https://github.com/CloudAndHeat/node_exporter","homepage":"https://prometheus.io/","size":1331,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prometheus:master","ref":"master","sha":"006d1c7922b765f458fe9b92ce646641bded0f52","user":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":9524057,"name":"node_exporter","full_name":"prometheus/node_exporter","owner":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/node_exporter","description":"Exporter for machine metrics","fork":false,"url":"https://api.github.com/repos/prometheus/node_exporter","forks_url":"https://api.github.com/repos/prometheus/node_exporter/forks","keys_url":"https://api.github.com/repos/prometheus/node_exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/node_exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/node_exporter/teams","hooks_url":"https://api.github.com/repos/prometheus/node_exporter/hooks","issue_events_url":"https://api.github.com/repos/prometheus/node_exporter/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/node_exporter/events","assignees_url":"https://api.github.com/repos/prometheus/node_exporter/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/node_exporter/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/node_exporter/tags","blobs_url":"https://api.github.com/repos/prometheus/node_exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/node_exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/node_exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/node_exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/node_exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/node_exporter/languages","stargazers_url":"https://api.github.com/repos/prometheus/node_exporter/stargazers","contributors_url":"https://api.github.com/repos/prometheus/node_exporter/contributors","subscribers_url":"https://api.github.com/repos/prometheus/node_exporter/subscribers","subscription_url":"https://api.github.com/repos/prometheus/node_exporter/subscription","commits_url":"https://api.github.com/repos/prometheus/node_exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/node_exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/node_exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/node_exporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/node_exporter/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/node_exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/node_exporter/merges","archive_url":"https://api.github.com/repos/prometheus/node_exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/node_exporter/downloads","issues_url":"https://api.github.com/repos/prometheus/node_exporter/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/node_exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/node_exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/node_exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/node_exporter/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/node_exporter/releases{/id}","deployments_url":"https://api.github.com/repos/prometheus/node_exporter/deployments","created_at":"2013-04-18T14:44:52Z","updated_at":"2016-12-21T08:37:17Z","pushed_at":"2016-12-21T11:23:44Z","git_url":"git://github.com/prometheus/node_exporter.git","ssh_url":"git@github.com:prometheus/node_exporter.git","clone_url":"https://github.com/prometheus/node_exporter.git","svn_url":"https://github.com/prometheus/node_exporter","homepage":"https://prometheus.io/","size":1669,"stargazers_count":378,"watchers_count":378,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":175,"mirror_url":null,"open_issues_count":55,"forks":175,"open_issues":55,"watchers":378,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/359"},"html":{"href":"https://github.com/prometheus/node_exporter/pull/359"},"issue":{"href":"https://api.github.com/repos/prometheus/node_exporter/issues/359"},"comments":{"href":"https://api.github.com/repos/prometheus/node_exporter/issues/359/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/359/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/359/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/node_exporter/statuses/3efaa1a6a89ad2d381b5d70ebb9fb69d198b4f49"}}}}
{"actor":{"display_login":"discordianfish"}}