{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments/74521825","id":74521825,"diff_hunk":"@@ -50,26 +47,20 @@ func (c *fileFDStatCollector) Update(ch chan<- prometheus.Metric) (err error) {\n \t\treturn fmt.Errorf(\"couldn't get file-nr: %s\", err)\n \t}\n \tfor name, value := range fileFDStat {\n-\t\tif _, ok := c.metrics[name]; !ok {\n-\t\t\tc.metrics[name] = prometheus.NewGauge(\n-\t\t\t\tprometheus.GaugeOpts{\n-\t\t\t\t\tNamespace: Namespace,\n-\t\t\t\t\tSubsystem: fileFDStatSubsystem,\n-\t\t\t\t\tName:      name,\n-\t\t\t\t\tHelp:      fmt.Sprintf(\"File descriptor statistics: %s.\", name),\n-\t\t\t\t},\n-\t\t\t)\n-\t\t}\n \t\tv, err := strconv.ParseFloat(value, 64)\n \t\tif err != nil {\n \t\t\treturn fmt.Errorf(\"invalid value %s in file-nr: %s\", value, err)\n \t\t}\n-\t\tc.metrics[name].Set(v)\n-\t}\n-\tfor _, m := range c.metrics {\n-\t\tm.Collect(ch)\n+\t\tch <- prometheus.MustNewConstMetric(\n+\t\t\tprometheus.NewDesc(\n+\t\t\t\tprometheus.BuildFQName(Namespace, fileFDStatSubsystem, name),\n+\t\t\t\tfmt.Sprintf(\"File descriptor statistics: %s.\", name),\n+\t\t\t\tnil, nil,\n+\t\t\t),\n+\t\t\tprometheus.UntypedValue, v,","path":"collector/filefd_linux.go","position":null,"original_position":63,"commit_id":"6bc01e0e50fd5b9443a4db349e6a338ccc91841c","original_commit_id":"cdf36f04fe967d3544807777d512937b0d381a07","user":{"login":"juliusv","id":538008,"avatar_url":"https://avatars.githubusercontent.com/u/538008?v=3","gravatar_id":"","url":"https://api.github.com/users/juliusv","html_url":"https://github.com/juliusv","followers_url":"https://api.github.com/users/juliusv/followers","following_url":"https://api.github.com/users/juliusv/following{/other_user}","gists_url":"https://api.github.com/users/juliusv/gists{/gist_id}","starred_url":"https://api.github.com/users/juliusv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliusv/subscriptions","organizations_url":"https://api.github.com/users/juliusv/orgs","repos_url":"https://api.github.com/users/juliusv/repos","events_url":"https://api.github.com/users/juliusv/events{/privacy}","received_events_url":"https://api.github.com/users/juliusv/received_events","type":"User","site_admin":false},"body":"Hm right, fixed.","created_at":"2016-08-11T23:25:47Z","updated_at":"2016-08-11T23:25:47Z","html_url":"https://github.com/prometheus/node_exporter/pull/282#discussion_r74521825","pull_request_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/282","_links":{"self":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments/74521825"},"html":{"href":"https://github.com/prometheus/node_exporter/pull/282#discussion_r74521825"},"pull_request":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/282"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/node_exporter/pulls/282","id":81047364,"html_url":"https://github.com/prometheus/node_exporter/pull/282","diff_url":"https://github.com/prometheus/node_exporter/pull/282.diff","patch_url":"https://github.com/prometheus/node_exporter/pull/282.patch","issue_url":"https://api.github.com/repos/prometheus/node_exporter/issues/282","number":282,"state":"open","locked":false,"title":"Convert filefd collector to use ConstMetrics","user":{"login":"juliusv","id":538008,"avatar_url":"https://avatars.githubusercontent.com/u/538008?v=3","gravatar_id":"","url":"https://api.github.com/users/juliusv","html_url":"https://github.com/juliusv","followers_url":"https://api.github.com/users/juliusv/followers","following_url":"https://api.github.com/users/juliusv/following{/other_user}","gists_url":"https://api.github.com/users/juliusv/gists{/gist_id}","starred_url":"https://api.github.com/users/juliusv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliusv/subscriptions","organizations_url":"https://api.github.com/users/juliusv/orgs","repos_url":"https://api.github.com/users/juliusv/repos","events_url":"https://api.github.com/users/juliusv/events{/privacy}","received_events_url":"https://api.github.com/users/juliusv/received_events","type":"User","site_admin":false},"body":"This suffers from the same concurrency bug as the netstat one:\r\nhttps://github.com/prometheus/node_exporter/issues/280","created_at":"2016-08-11T23:22:15Z","updated_at":"2016-08-11T23:25:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4a41fcb1dcbaf1fe617136af2c2f5e8ea49012d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/282/commits","review_comments_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/282/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/282/comments","statuses_url":"https://api.github.com/repos/prometheus/node_exporter/statuses/6bc01e0e50fd5b9443a4db349e6a338ccc91841c","head":{"label":"prometheus:filefd-constmetrics","ref":"filefd-constmetrics","sha":"6bc01e0e50fd5b9443a4db349e6a338ccc91841c","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-08-11T08:22:18Z","pushed_at":"2016-08-11T23:25:45Z","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":1630,"stargazers_count":231,"watchers_count":231,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":131,"mirror_url":null,"open_issues_count":36,"forks":131,"open_issues":36,"watchers":231,"default_branch":"master"}},"base":{"label":"prometheus:master","ref":"master","sha":"9128952454a1490d90f570466598ad98f22f2fad","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-08-11T08:22:18Z","pushed_at":"2016-08-11T23:25:45Z","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":1630,"stargazers_count":231,"watchers_count":231,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":131,"mirror_url":null,"open_issues_count":36,"forks":131,"open_issues":36,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/282"},"html":{"href":"https://github.com/prometheus/node_exporter/pull/282"},"issue":{"href":"https://api.github.com/repos/prometheus/node_exporter/issues/282"},"comments":{"href":"https://api.github.com/repos/prometheus/node_exporter/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/282/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/282/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/node_exporter/statuses/6bc01e0e50fd5b9443a4db349e6a338ccc91841c"}}}}
{"actor":{"display_login":"juliusv"}}