{"action":"created","comment":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/comments/230564921","pull_request_review_id":171338309,"id":230564921,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDU2NDkyMQ==","diff_hunk":"@@ -342,3 +342,84 @@ func TestCumulativenessFromHistograms(t *testing.T) {\n \t\tt.Fatalf(\"\\ngot:\\n%s\\n\\nwant:\\n%s\\n\", got, want)\n \t}\n }\n+\n+func TestConstLabelsIncluded(t *testing.T) {\n+\tkey, label := \"service\", \"spanner\"\n+\texporter, err := NewExporter(Options{\n+\t\tConstLabels: prometheus.Labels{\n+\t\t\tkey: label,\n+\t\t},\n+\t})\n+\tif err != nil {\n+\t\tt.Fatalf(\"failed to create prometheus exporter: %v\", err)\n+\t}\n+\tview.RegisterExporter(exporter)\n+\n+\tnames := []string{\"foo\", \"bar\", \"baz\"}\n+\n+\tvar measures mSlice\n+\tfor _, name := range names {\n+\t\tmeasures.createAndAppend(\"tests/\"+name, name, \"\")\n+\t}\n+\n+\tvar vc vCreator\n+\tfor _, m := range measures {\n+\t\tvc.createAndAppend(m.Name(), m.Description(), nil, m, view.Count())\n+\t}\n+\n+\tif err := view.Register(vc...); err != nil {\n+\t\tt.Fatalf(\"failed to create views: %v\", err)\n+\t}\n+\tdefer view.Unregister(vc...)\n+\n+\tview.SetReportingPeriod(time.Millisecond)\n+\n+\tfor _, m := range measures {\n+\t\tstats.Record(context.Background(), m.M(1))\n+\t}\n+\n+\tsrv := httptest.NewServer(exporter)\n+\tdefer srv.Close()\n+\n+\tvar i int\n+\tvar output string\n+\tfor {\n+\t\ttime.Sleep(10 * time.Millisecond)\n+\t\tif i == 1000 {\n+\t\t\tt.Fatal(\"no output at /metrics (10s wait)\")\n+\t\t}\n+\t\ti++\n+\n+\t\tresp, err := http.Get(srv.URL)\n+\t\tif err != nil {\n+\t\t\tt.Fatalf(\"failed to get /metrics: %v\", err)\n+\t\t}\n+\n+\t\tbody, err := ioutil.ReadAll(resp.Body)\n+\t\tif err != nil {\n+\t\t\tt.Fatalf(\"failed to read body: %v\", err)\n+\t\t}\n+\t\tresp.Body.Close()\n+\n+\t\toutput = string(body)\n+\t\tif output != \"\" {\n+\t\t\tbreak\n+\t\t}\n+\t}\n+\n+\tt.Log(output)\n+\n+\tif strings.Contains(output, \"collected before with the same name and label values\") {\n+\t\tt.Fatal(\"metric name and labels being duplicated but must be unique\")\n+\t}\n+\n+\tif strings.Contains(output, \"error(s) occurred\") {\n+\t\tt.Fatal(\"error reported by prometheus registry\")\n+\t}\n+\n+\tfor _, name := range names {","path":"exporter/prometheus/prometheus_test.go","position":79,"original_position":79,"commit_id":"903df130717a9fda3424f24eb160c5376e72491d","original_commit_id":"903df130717a9fda3424f24eb160c5376e72491d","user":{"login":"johanbrandhorst","id":6604151,"node_id":"MDQ6VXNlcjY2MDQxNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/6604151?v=4","gravatar_id":"","url":"https://api.github.com/users/johanbrandhorst","html_url":"https://github.com/johanbrandhorst","followers_url":"https://api.github.com/users/johanbrandhorst/followers","following_url":"https://api.github.com/users/johanbrandhorst/following{/other_user}","gists_url":"https://api.github.com/users/johanbrandhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/johanbrandhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanbrandhorst/subscriptions","organizations_url":"https://api.github.com/users/johanbrandhorst/orgs","repos_url":"https://api.github.com/users/johanbrandhorst/repos","events_url":"https://api.github.com/users/johanbrandhorst/events{/privacy}","received_events_url":"https://api.github.com/users/johanbrandhorst/received_events","type":"User","site_admin":false},"body":"OK, can do!","created_at":"2018-11-03T19:14:53Z","updated_at":"2018-11-03T19:14:53Z","html_url":"https://github.com/census-instrumentation/opencensus-go/pull/962#discussion_r230564921","pull_request_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/962","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/comments/230564921"},"html":{"href":"https://github.com/census-instrumentation/opencensus-go/pull/962#discussion_r230564921"},"pull_request":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/962"}},"in_reply_to_id":230564813},"pull_request":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/962","id":226892700,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2ODkyNzAw","html_url":"https://github.com/census-instrumentation/opencensus-go/pull/962","diff_url":"https://github.com/census-instrumentation/opencensus-go/pull/962.diff","patch_url":"https://github.com/census-instrumentation/opencensus-go/pull/962.patch","issue_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/issues/962","number":962,"state":"open","locked":false,"title":"exporter/prometheus: allow labels to be configured","user":{"login":"johanbrandhorst","id":6604151,"node_id":"MDQ6VXNlcjY2MDQxNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/6604151?v=4","gravatar_id":"","url":"https://api.github.com/users/johanbrandhorst","html_url":"https://github.com/johanbrandhorst","followers_url":"https://api.github.com/users/johanbrandhorst/followers","following_url":"https://api.github.com/users/johanbrandhorst/following{/other_user}","gists_url":"https://api.github.com/users/johanbrandhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/johanbrandhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanbrandhorst/subscriptions","organizations_url":"https://api.github.com/users/johanbrandhorst/orgs","repos_url":"https://api.github.com/users/johanbrandhorst/repos","events_url":"https://api.github.com/users/johanbrandhorst/events{/privacy}","received_events_url":"https://api.github.com/users/johanbrandhorst/received_events","type":"User","site_admin":false},"body":"Allows the user to configure labels consistent across\r\nall views for the exporter.\r\n\r\nFixes #961","created_at":"2018-10-30T11:57:12Z","updated_at":"2018-11-03T19:14:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a299a2e48f4679114c0d6ea4ee6df0e52c9b6195","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/962/commits","review_comments_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/962/comments","review_comment_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/issues/962/comments","statuses_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/statuses/903df130717a9fda3424f24eb160c5376e72491d","head":{"label":"johanbrandhorst:patch-4","ref":"patch-4","sha":"903df130717a9fda3424f24eb160c5376e72491d","user":{"login":"johanbrandhorst","id":6604151,"node_id":"MDQ6VXNlcjY2MDQxNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/6604151?v=4","gravatar_id":"","url":"https://api.github.com/users/johanbrandhorst","html_url":"https://github.com/johanbrandhorst","followers_url":"https://api.github.com/users/johanbrandhorst/followers","following_url":"https://api.github.com/users/johanbrandhorst/following{/other_user}","gists_url":"https://api.github.com/users/johanbrandhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/johanbrandhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanbrandhorst/subscriptions","organizations_url":"https://api.github.com/users/johanbrandhorst/orgs","repos_url":"https://api.github.com/users/johanbrandhorst/repos","events_url":"https://api.github.com/users/johanbrandhorst/events{/privacy}","received_events_url":"https://api.github.com/users/johanbrandhorst/received_events","type":"User","site_admin":false},"repo":{"id":129399796,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkzOTk3OTY=","name":"opencensus-go","full_name":"johanbrandhorst/opencensus-go","private":false,"owner":{"login":"johanbrandhorst","id":6604151,"node_id":"MDQ6VXNlcjY2MDQxNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/6604151?v=4","gravatar_id":"","url":"https://api.github.com/users/johanbrandhorst","html_url":"https://github.com/johanbrandhorst","followers_url":"https://api.github.com/users/johanbrandhorst/followers","following_url":"https://api.github.com/users/johanbrandhorst/following{/other_user}","gists_url":"https://api.github.com/users/johanbrandhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/johanbrandhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanbrandhorst/subscriptions","organizations_url":"https://api.github.com/users/johanbrandhorst/orgs","repos_url":"https://api.github.com/users/johanbrandhorst/repos","events_url":"https://api.github.com/users/johanbrandhorst/events{/privacy}","received_events_url":"https://api.github.com/users/johanbrandhorst/received_events","type":"User","site_admin":false},"html_url":"https://github.com/johanbrandhorst/opencensus-go","description":"A stats collection and distributed tracing framework","fork":true,"url":"https://api.github.com/repos/johanbrandhorst/opencensus-go","forks_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/forks","keys_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/teams","hooks_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/hooks","issue_events_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/issues/events{/number}","events_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/events","assignees_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/assignees{/user}","branches_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/branches{/branch}","tags_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/tags","blobs_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/statuses/{sha}","languages_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/languages","stargazers_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/stargazers","contributors_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/contributors","subscribers_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/subscribers","subscription_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/subscription","commits_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/contents/{+path}","compare_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/merges","archive_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/downloads","issues_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/issues{/number}","pulls_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/pulls{/number}","milestones_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/milestones{/number}","notifications_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/labels{/name}","releases_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/releases{/id}","deployments_url":"https://api.github.com/repos/johanbrandhorst/opencensus-go/deployments","created_at":"2018-04-13T12:32:29Z","updated_at":"2018-04-13T12:32:31Z","pushed_at":"2018-11-03T18:55:45Z","git_url":"git://github.com/johanbrandhorst/opencensus-go.git","ssh_url":"git@github.com:johanbrandhorst/opencensus-go.git","clone_url":"https://github.com/johanbrandhorst/opencensus-go.git","svn_url":"https://github.com/johanbrandhorst/opencensus-go","homepage":"http://opencensus.io","size":1613,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"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":"census-instrumentation:master","ref":"master","sha":"4f7fcb478fc0e34627b4da801e1502ee05a87127","user":{"login":"census-instrumentation","id":26944525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2OTQ0NTI1","avatar_url":"https://avatars0.githubusercontent.com/u/26944525?v=4","gravatar_id":"","url":"https://api.github.com/users/census-instrumentation","html_url":"https://github.com/census-instrumentation","followers_url":"https://api.github.com/users/census-instrumentation/followers","following_url":"https://api.github.com/users/census-instrumentation/following{/other_user}","gists_url":"https://api.github.com/users/census-instrumentation/gists{/gist_id}","starred_url":"https://api.github.com/users/census-instrumentation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/census-instrumentation/subscriptions","organizations_url":"https://api.github.com/users/census-instrumentation/orgs","repos_url":"https://api.github.com/users/census-instrumentation/repos","events_url":"https://api.github.com/users/census-instrumentation/events{/privacy}","received_events_url":"https://api.github.com/users/census-instrumentation/received_events","type":"Organization","site_admin":false},"repo":{"id":81387692,"node_id":"MDEwOlJlcG9zaXRvcnk4MTM4NzY5Mg==","name":"opencensus-go","full_name":"census-instrumentation/opencensus-go","private":false,"owner":{"login":"census-instrumentation","id":26944525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2OTQ0NTI1","avatar_url":"https://avatars0.githubusercontent.com/u/26944525?v=4","gravatar_id":"","url":"https://api.github.com/users/census-instrumentation","html_url":"https://github.com/census-instrumentation","followers_url":"https://api.github.com/users/census-instrumentation/followers","following_url":"https://api.github.com/users/census-instrumentation/following{/other_user}","gists_url":"https://api.github.com/users/census-instrumentation/gists{/gist_id}","starred_url":"https://api.github.com/users/census-instrumentation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/census-instrumentation/subscriptions","organizations_url":"https://api.github.com/users/census-instrumentation/orgs","repos_url":"https://api.github.com/users/census-instrumentation/repos","events_url":"https://api.github.com/users/census-instrumentation/events{/privacy}","received_events_url":"https://api.github.com/users/census-instrumentation/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/census-instrumentation/opencensus-go","description":"A stats collection and distributed tracing framework","fork":false,"url":"https://api.github.com/repos/census-instrumentation/opencensus-go","forks_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/forks","keys_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/teams","hooks_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/hooks","issue_events_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/issues/events{/number}","events_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/events","assignees_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/assignees{/user}","branches_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/branches{/branch}","tags_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/tags","blobs_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/statuses/{sha}","languages_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/languages","stargazers_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/stargazers","contributors_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/contributors","subscribers_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/subscribers","subscription_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/subscription","commits_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/contents/{+path}","compare_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/merges","archive_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/downloads","issues_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/issues{/number}","pulls_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls{/number}","milestones_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/milestones{/number}","notifications_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/labels{/name}","releases_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/releases{/id}","deployments_url":"https://api.github.com/repos/census-instrumentation/opencensus-go/deployments","created_at":"2017-02-08T23:40:07Z","updated_at":"2018-11-03T18:15:17Z","pushed_at":"2018-11-03T18:55:46Z","git_url":"git://github.com/census-instrumentation/opencensus-go.git","ssh_url":"git@github.com:census-instrumentation/opencensus-go.git","clone_url":"https://github.com/census-instrumentation/opencensus-go.git","svn_url":"https://github.com/census-instrumentation/opencensus-go","homepage":"http://opencensus.io","size":1614,"stargazers_count":1169,"watchers_count":1169,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":151,"mirror_url":null,"archived":false,"open_issues_count":71,"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":151,"open_issues":71,"watchers":1169,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/962"},"html":{"href":"https://github.com/census-instrumentation/opencensus-go/pull/962"},"issue":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/issues/962"},"comments":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/issues/962/comments"},"review_comments":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/962/comments"},"review_comment":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/pulls/962/commits"},"statuses":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-go/statuses/903df130717a9fda3424f24eb160c5376e72491d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"johanbrandhorst"}}