{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/12","labels_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/12/comments","events_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/12/events","html_url":"https://github.com/prometheus/jmx_exporter/pull/12","id":56976151,"number":12,"title":"Add options for full JMX URL, Username and Password","user":{"login":"cetra3","id":6415435,"avatar_url":"https://avatars.githubusercontent.com/u/6415435?v=3","gravatar_id":"","url":"https://api.github.com/users/cetra3","html_url":"https://github.com/cetra3","followers_url":"https://api.github.com/users/cetra3/followers","following_url":"https://api.github.com/users/cetra3/following{/other_user}","gists_url":"https://api.github.com/users/cetra3/gists{/gist_id}","starred_url":"https://api.github.com/users/cetra3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cetra3/subscriptions","organizations_url":"https://api.github.com/users/cetra3/orgs","repos_url":"https://api.github.com/users/cetra3/repos","events_url":"https://api.github.com/users/cetra3/events{/privacy}","received_events_url":"https://api.github.com/users/cetra3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-09T00:28:57Z","updated_at":"2015-03-02T03:24:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/12","html_url":"https://github.com/prometheus/jmx_exporter/pull/12","diff_url":"https://github.com/prometheus/jmx_exporter/pull/12.diff","patch_url":"https://github.com/prometheus/jmx_exporter/pull/12.patch"},"body":"This pull request includes a few more optional configuration items to be able to properly set the JMX connection URL and also specify a username & password.  This should be compatible with existing configurations, and if anyone is using the `JmxScraper` class directly, this should also work in the exact same way.\r\n\r\nThe 3 new options are:\r\n  * **hostUrl**: specify the full JMX URL.  If this isn't defined, it'll create this from hostPort, or set it to nothing if that's not defined (current behaviour).\r\n  * **username**: specify the username when connecting to JMX  Both username and password have to be set for this to be used.\r\n  * **password**: specify the password when connecting to JMX.  Both username and password have to be set for this to be used.\r\n\r\n`JmxScraper` has a new overloaded constructor for the `env` variable, which defaults to `null` if username or password is not set (current behaviour).\r\n\r\nWe also check to see whether hostUrl is in `host:port` form or full URL form by checking for the presence of a`/` character, which is not a valid character for either the hostname or the port number.\r\n\r\nThe net effect of this change is if you're using either of these classes, their behaviour should not change, unless you're using the 3 above options.\r\n\r\nAlso added the full stack trace to the logger, which prints out a bit more useful information.\r\n"},"comment":{"url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/comments/76653625","html_url":"https://github.com/prometheus/jmx_exporter/pull/12#issuecomment-76653625","issue_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/12","id":76653625,"user":{"login":"cetra3","id":6415435,"avatar_url":"https://avatars.githubusercontent.com/u/6415435?v=3","gravatar_id":"","url":"https://api.github.com/users/cetra3","html_url":"https://github.com/cetra3","followers_url":"https://api.github.com/users/cetra3/followers","following_url":"https://api.github.com/users/cetra3/following{/other_user}","gists_url":"https://api.github.com/users/cetra3/gists{/gist_id}","starred_url":"https://api.github.com/users/cetra3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cetra3/subscriptions","organizations_url":"https://api.github.com/users/cetra3/orgs","repos_url":"https://api.github.com/users/cetra3/repos","events_url":"https://api.github.com/users/cetra3/events{/privacy}","received_events_url":"https://api.github.com/users/cetra3/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T03:24:08Z","updated_at":"2015-03-02T03:24:08Z","body":"Should I close this commit and open a new one with your suggested changes? Or did you want me to append this one."}}