{"action":"created","comment":{"url":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/comments/120533010","pull_request_review_id":42501718,"id":120533010,"diff_hunk":"@@ -132,12 +136,38 @@ public double get() {\n             };\n \n             gauge.setChild(child, labelValues);\n-            return new PrometheusGauge(name, child);\n+            return new PrometheusGauge(id, child);\n         });\n \n         return obj;\n     }\n \n+    @Override\n+    public MeterRegistry register(Meter meter) {\n+        Collector collector = new Collector() {\n+            @Override\n+            public List<MetricFamilySamples> collect() {\n+                List<MetricFamilySamples.Sample> samples = stream(meter.measure().spliterator(), false)\n+                        .map(m -> {\n+                            List<String> tagKeys = new ArrayList<>(m.getTags().size());\n+                            List<String> tagValues = new ArrayList<>(m.getTags().size());\n+                            for (Tag tag : m.getTags()) {\n+                                tagKeys.add(tag.getKey());\n+                                tagValues.add(tag.getValue());\n+                            }\n+                            return new MetricFamilySamples.Sample(m.getName(), tagKeys, tagValues, m.getValue());","path":"src/main/java/org/springframework/metrics/instrument/prometheus/PrometheusMeterRegistry.java","position":113,"original_position":113,"commit_id":"e35a395ef80b80efb54947ba8a65121259b0e902","original_commit_id":"e35a395ef80b80efb54947ba8a65121259b0e902","user":{"login":"checketts","id":416063,"avatar_url":"https://avatars3.githubusercontent.com/u/416063?v=3","gravatar_id":"","url":"https://api.github.com/users/checketts","html_url":"https://github.com/checketts","followers_url":"https://api.github.com/users/checketts/followers","following_url":"https://api.github.com/users/checketts/following{/other_user}","gists_url":"https://api.github.com/users/checketts/gists{/gist_id}","starred_url":"https://api.github.com/users/checketts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/checketts/subscriptions","organizations_url":"https://api.github.com/users/checketts/orgs","repos_url":"https://api.github.com/users/checketts/repos","events_url":"https://api.github.com/users/checketts/events{/privacy}","received_events_url":"https://api.github.com/users/checketts/received_events","type":"User","site_admin":false},"body":"> Do two or more MetricFamilySamples imply multiple meters?\r\n\r\nNo take the [guava cache collector](https://github.com/prometheus/client_java/blob/master/simpleclient_guava/src/main/java/io/prometheus/client/guava/cache/CacheMetricsCollector.java#L91) as an example \r\n","created_at":"2017-06-07T04:37:05Z","updated_at":"2017-06-07T04:37:05Z","html_url":"https://github.com/spring-projects/spring-metrics/pull/36#discussion_r120533010","pull_request_url":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/comments/120533010"},"html":{"href":"https://github.com/spring-projects/spring-metrics/pull/36#discussion_r120533010"},"pull_request":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/36","id":124331403,"html_url":"https://github.com/spring-projects/spring-metrics/pull/36","diff_url":"https://github.com/spring-projects/spring-metrics/pull/36.diff","patch_url":"https://github.com/spring-projects/spring-metrics/pull/36.patch","issue_url":"https://api.github.com/repos/spring-projects/spring-metrics/issues/36","number":36,"state":"closed","locked":false,"title":"Add custom meter registration","user":{"login":"jkschneider","id":1697736,"avatar_url":"https://avatars1.githubusercontent.com/u/1697736?v=3","gravatar_id":"","url":"https://api.github.com/users/jkschneider","html_url":"https://github.com/jkschneider","followers_url":"https://api.github.com/users/jkschneider/followers","following_url":"https://api.github.com/users/jkschneider/following{/other_user}","gists_url":"https://api.github.com/users/jkschneider/gists{/gist_id}","starred_url":"https://api.github.com/users/jkschneider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkschneider/subscriptions","organizations_url":"https://api.github.com/users/jkschneider/orgs","repos_url":"https://api.github.com/users/jkschneider/repos","events_url":"https://api.github.com/users/jkschneider/events{/privacy}","received_events_url":"https://api.github.com/users/jkschneider/received_events","type":"User","site_admin":false},"body":"As a side effect:\r\n\r\n* Every `Meter` now implements `Iterable<Measurement> measure()`\r\n* Every `Meter` now implements `Iterable<Tag> getTag()`.\r\n* `MeterRegistry` now has a `MeterRegistry register(Meter meter)` method.","created_at":"2017-06-07T03:51:58Z","updated_at":"2017-06-07T04:37:05Z","closed_at":"2017-06-07T04:00:30Z","merged_at":"2017-06-07T04:00:30Z","merge_commit_sha":"ffa7a7e3f762df1d7d508ca9101432890d35d1d4","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/36/commits","review_comments_url":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/36/comments","review_comment_url":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-projects/spring-metrics/issues/36/comments","statuses_url":"https://api.github.com/repos/spring-projects/spring-metrics/statuses/e35a395ef80b80efb54947ba8a65121259b0e902","head":{"label":"spring-projects:add-measures","ref":"add-measures","sha":"e35a395ef80b80efb54947ba8a65121259b0e902","user":{"login":"spring-projects","id":317776,"avatar_url":"https://avatars3.githubusercontent.com/u/317776?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":87859908,"name":"spring-metrics","full_name":"spring-projects/spring-metrics","owner":{"login":"spring-projects","id":317776,"avatar_url":"https://avatars3.githubusercontent.com/u/317776?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-projects/spring-metrics","description":"Work-in-progress on Spring metrics.","fork":false,"url":"https://api.github.com/repos/spring-projects/spring-metrics","forks_url":"https://api.github.com/repos/spring-projects/spring-metrics/forks","keys_url":"https://api.github.com/repos/spring-projects/spring-metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-projects/spring-metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-projects/spring-metrics/teams","hooks_url":"https://api.github.com/repos/spring-projects/spring-metrics/hooks","issue_events_url":"https://api.github.com/repos/spring-projects/spring-metrics/issues/events{/number}","events_url":"https://api.github.com/repos/spring-projects/spring-metrics/events","assignees_url":"https://api.github.com/repos/spring-projects/spring-metrics/assignees{/user}","branches_url":"https://api.github.com/repos/spring-projects/spring-metrics/branches{/branch}","tags_url":"https://api.github.com/repos/spring-projects/spring-metrics/tags","blobs_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-projects/spring-metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-projects/spring-metrics/languages","stargazers_url":"https://api.github.com/repos/spring-projects/spring-metrics/stargazers","contributors_url":"https://api.github.com/repos/spring-projects/spring-metrics/contributors","subscribers_url":"https://api.github.com/repos/spring-projects/spring-metrics/subscribers","subscription_url":"https://api.github.com/repos/spring-projects/spring-metrics/subscription","commits_url":"https://api.github.com/repos/spring-projects/spring-metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-projects/spring-metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-projects/spring-metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-projects/spring-metrics/contents/{+path}","compare_url":"https://api.github.com/repos/spring-projects/spring-metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-projects/spring-metrics/merges","archive_url":"https://api.github.com/repos/spring-projects/spring-metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-projects/spring-metrics/downloads","issues_url":"https://api.github.com/repos/spring-projects/spring-metrics/issues{/number}","pulls_url":"https://api.github.com/repos/spring-projects/spring-metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-projects/spring-metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-projects/spring-metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-projects/spring-metrics/labels{/name}","releases_url":"https://api.github.com/repos/spring-projects/spring-metrics/releases{/id}","deployments_url":"https://api.github.com/repos/spring-projects/spring-metrics/deployments","created_at":"2017-04-10T21:36:51Z","updated_at":"2017-05-27T15:22:01Z","pushed_at":"2017-06-07T04:36:00Z","git_url":"git://github.com/spring-projects/spring-metrics.git","ssh_url":"git@github.com:spring-projects/spring-metrics.git","clone_url":"https://github.com/spring-projects/spring-metrics.git","svn_url":"https://github.com/spring-projects/spring-metrics","homepage":"","size":1752,"stargazers_count":74,"watchers_count":74,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":14,"forks":13,"open_issues":14,"watchers":74,"default_branch":"master"}},"base":{"label":"spring-projects:master","ref":"master","sha":"a09144e201f51efe168c2fc2acc31951ce398482","user":{"login":"spring-projects","id":317776,"avatar_url":"https://avatars3.githubusercontent.com/u/317776?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":87859908,"name":"spring-metrics","full_name":"spring-projects/spring-metrics","owner":{"login":"spring-projects","id":317776,"avatar_url":"https://avatars3.githubusercontent.com/u/317776?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-projects/spring-metrics","description":"Work-in-progress on Spring metrics.","fork":false,"url":"https://api.github.com/repos/spring-projects/spring-metrics","forks_url":"https://api.github.com/repos/spring-projects/spring-metrics/forks","keys_url":"https://api.github.com/repos/spring-projects/spring-metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-projects/spring-metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-projects/spring-metrics/teams","hooks_url":"https://api.github.com/repos/spring-projects/spring-metrics/hooks","issue_events_url":"https://api.github.com/repos/spring-projects/spring-metrics/issues/events{/number}","events_url":"https://api.github.com/repos/spring-projects/spring-metrics/events","assignees_url":"https://api.github.com/repos/spring-projects/spring-metrics/assignees{/user}","branches_url":"https://api.github.com/repos/spring-projects/spring-metrics/branches{/branch}","tags_url":"https://api.github.com/repos/spring-projects/spring-metrics/tags","blobs_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-projects/spring-metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-projects/spring-metrics/languages","stargazers_url":"https://api.github.com/repos/spring-projects/spring-metrics/stargazers","contributors_url":"https://api.github.com/repos/spring-projects/spring-metrics/contributors","subscribers_url":"https://api.github.com/repos/spring-projects/spring-metrics/subscribers","subscription_url":"https://api.github.com/repos/spring-projects/spring-metrics/subscription","commits_url":"https://api.github.com/repos/spring-projects/spring-metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-projects/spring-metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-projects/spring-metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-projects/spring-metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-projects/spring-metrics/contents/{+path}","compare_url":"https://api.github.com/repos/spring-projects/spring-metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-projects/spring-metrics/merges","archive_url":"https://api.github.com/repos/spring-projects/spring-metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-projects/spring-metrics/downloads","issues_url":"https://api.github.com/repos/spring-projects/spring-metrics/issues{/number}","pulls_url":"https://api.github.com/repos/spring-projects/spring-metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-projects/spring-metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-projects/spring-metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-projects/spring-metrics/labels{/name}","releases_url":"https://api.github.com/repos/spring-projects/spring-metrics/releases{/id}","deployments_url":"https://api.github.com/repos/spring-projects/spring-metrics/deployments","created_at":"2017-04-10T21:36:51Z","updated_at":"2017-05-27T15:22:01Z","pushed_at":"2017-06-07T04:36:00Z","git_url":"git://github.com/spring-projects/spring-metrics.git","ssh_url":"git@github.com:spring-projects/spring-metrics.git","clone_url":"https://github.com/spring-projects/spring-metrics.git","svn_url":"https://github.com/spring-projects/spring-metrics","homepage":"","size":1752,"stargazers_count":74,"watchers_count":74,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":14,"forks":13,"open_issues":14,"watchers":74,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/36"},"html":{"href":"https://github.com/spring-projects/spring-metrics/pull/36"},"issue":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/issues/36"},"comments":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/spring-projects/spring-metrics/statuses/e35a395ef80b80efb54947ba8a65121259b0e902"}}}}
{"actor":{"display_login":"checketts"}}