{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/client_java/issues/344","repository_url":"https://api.github.com/repos/prometheus/client_java","labels_url":"https://api.github.com/repos/prometheus/client_java/issues/344/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/client_java/issues/344/comments","events_url":"https://api.github.com/repos/prometheus/client_java/issues/344/events","html_url":"https://github.com/prometheus/client_java/issues/344","id":297871247,"number":344,"title":"NullPointerException setting labels for histogram in java client","user":{"login":"jtktam","id":11771887,"avatar_url":"https://avatars3.githubusercontent.com/u/11771887?v=4","gravatar_id":"","url":"https://api.github.com/users/jtktam","html_url":"https://github.com/jtktam","followers_url":"https://api.github.com/users/jtktam/followers","following_url":"https://api.github.com/users/jtktam/following{/other_user}","gists_url":"https://api.github.com/users/jtktam/gists{/gist_id}","starred_url":"https://api.github.com/users/jtktam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtktam/subscriptions","organizations_url":"https://api.github.com/users/jtktam/orgs","repos_url":"https://api.github.com/users/jtktam/repos","events_url":"https://api.github.com/users/jtktam/events{/privacy}","received_events_url":"https://api.github.com/users/jtktam/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-16T18:00:43Z","updated_at":"2018-02-16T18:19:48Z","closed_at":"2018-02-16T18:03:42Z","author_association":"NONE","body":"Histogram callDuration = Histogram.build().name(\"some_metric\").help(\"Some Metric\").labelNames(\"production\",\"server1\");\r\n...\r\nHistogram.Timer timer = callDuration.startTimer();\r\n\r\n**this causes a null pointer exception when it tries to set timer on the histogram**\r\n\r\nremoving the labelNames so that the declaration is \r\n\r\nHistogram callDuration = Histogram.build().name(\"some_metric\").help(\"Some Metric\");\r\n...\r\nHistogram.Timer timer = callDuration.startTimer();\r\n\r\n**this works**\r\n\r\nif labels are not supported for histogram then the method shouldn't accept and set the labels.. then crash when you actually use it"},"comment":{"url":"https://api.github.com/repos/prometheus/client_java/issues/comments/366316595","html_url":"https://github.com/prometheus/client_java/issues/344#issuecomment-366316595","issue_url":"https://api.github.com/repos/prometheus/client_java/issues/344","id":366316595,"user":{"login":"jtktam","id":11771887,"avatar_url":"https://avatars3.githubusercontent.com/u/11771887?v=4","gravatar_id":"","url":"https://api.github.com/users/jtktam","html_url":"https://github.com/jtktam","followers_url":"https://api.github.com/users/jtktam/followers","following_url":"https://api.github.com/users/jtktam/following{/other_user}","gists_url":"https://api.github.com/users/jtktam/gists{/gist_id}","starred_url":"https://api.github.com/users/jtktam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtktam/subscriptions","organizations_url":"https://api.github.com/users/jtktam/orgs","repos_url":"https://api.github.com/users/jtktam/repos","events_url":"https://api.github.com/users/jtktam/events{/privacy}","received_events_url":"https://api.github.com/users/jtktam/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T18:19:48Z","updated_at":"2018-02-16T18:19:48Z","author_association":"NONE","body":"if histogram extends simplecollector<histogram.child> and the labels method is only on the histogram.child, your suggestion of using the labels method would mean an extra unnecessary declaration.  shouldn't there be a way to call labels from histogram directly?"}}
{"actor":{"display_login":"jtktam"}}