{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/comments/23003581","id":23003581,"diff_hunk":"@@ -1,29 +1,75 @@\n-jmx4prometheus\n+JMX Exporter\n =====\n \n-JMX to prometheus bridge.\n+JMX to Prometheus bridge.\n \n-A webserver that exposes mBeans of a JMX target in JSON format suitable\n-for http://github.com/prometheus.\n-\n-# About\n-A prometheus server makes a JSON request to a the jmx4prometheus server which then\n-scrapes all beans of a target JMX port on another process. The target can\n-either be statically configured in the configuration or passed in by\n-prometheus server as a query string parameter.\n-Jmx4prometheus can return all mBeans (that are numeric) or be configured with\n-whitelist/blacklist behaviour.\n+A Collector that can configurably scrape and expose mBeans of a JMX target.\n+You can optionally run this as a HTTP server and/or scrape via remote JMX.\n \n ## Building and Running\n \n `mvn package` to build.\n-See `run_jmx4prometheus_server.sh` for a sample script that runs the webserver.\n+See `./run_sample_httpserver.sh` for a sample script that runs the httpserver against itself.\n+\n+## Configuration\n+The configuration is in JSON, an example with all possible options:\n+```\n+{ \n+  \"hostPort\": \"127.0.0.1:1234\",\n+  \"rules\": [\n+    {\"pattern\": \"^org.apache.cassandra.metrics<type=(\\w+), name=(\\w+)><>Value:\",\n+     \"name\": \"cassandra_$1_$2\",\n+     \"labels\": {},\n+     \"help\": \"Cassandra metric $1 $2\",\n+     \"type\": \"GAUGE\",\n+     \"attrNameSnakeCase\": false},\n+  ]\n+}\n+```\n+Name     | Description\n+---------|------------\n+hostPort | The host and port to connect to via remote JMX. If not specified, will talk to the local JVM.\n+rules    | A list of rules to apply in order, processing stops at the first matching rule. Attributes that aren't matched aren't collected. If not specified, defaults to collection everything in the default format.\n+pattern  | Pattern to match against each bean attribute. The pattern is not anchored. Capture groups can be used in other options. Defaults to matching everything.","path":"README.md","position":46,"original_position":46,"commit_id":"2ae55c8d03b6596588c2b18ecba37ada93544aaa","original_commit_id":"e0a49c12c9197fa10ef6971068a64d43e28f720e","user":{"login":"typingduck","id":187888,"avatar_url":"https://avatars.githubusercontent.com/u/187888?v=3","gravatar_id":"","url":"https://api.github.com/users/typingduck","html_url":"https://github.com/typingduck","followers_url":"https://api.github.com/users/typingduck/followers","following_url":"https://api.github.com/users/typingduck/following{/other_user}","gists_url":"https://api.github.com/users/typingduck/gists{/gist_id}","starred_url":"https://api.github.com/users/typingduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typingduck/subscriptions","organizations_url":"https://api.github.com/users/typingduck/orgs","repos_url":"https://api.github.com/users/typingduck/repos","events_url":"https://api.github.com/users/typingduck/events{/privacy}","received_events_url":"https://api.github.com/users/typingduck/received_events","type":"User","site_admin":false},"body":"pattern = regex of some kind?","created_at":"2015-01-15T11:20:59Z","updated_at":"2015-01-15T11:20:59Z","html_url":"https://github.com/prometheus/jmx_exporter/pull/4#discussion_r23003581","pull_request_url":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/comments/23003581"},"html":{"href":"https://github.com/prometheus/jmx_exporter/pull/4#discussion_r23003581"},"pull_request":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/4","id":25684494,"html_url":"https://github.com/prometheus/jmx_exporter/pull/4","diff_url":"https://github.com/prometheus/jmx_exporter/pull/4.diff","patch_url":"https://github.com/prometheus/jmx_exporter/pull/4.patch","issue_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/4","number":4,"state":"open","locked":false,"title":"New more configurable version of JMX exporter, using simpleclient.","user":{"login":"brian-brazil","id":7115638,"avatar_url":"https://avatars.githubusercontent.com/u/7115638?v=3","gravatar_id":"","url":"https://api.github.com/users/brian-brazil","html_url":"https://github.com/brian-brazil","followers_url":"https://api.github.com/users/brian-brazil/followers","following_url":"https://api.github.com/users/brian-brazil/following{/other_user}","gists_url":"https://api.github.com/users/brian-brazil/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-brazil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-brazil/subscriptions","organizations_url":"https://api.github.com/users/brian-brazil/orgs","repos_url":"https://api.github.com/users/brian-brazil/repos","events_url":"https://api.github.com/users/brian-brazil/events{/privacy}","received_events_url":"https://api.github.com/users/brian-brazil/received_events","type":"User","site_admin":false},"body":"It supports:\r\n- Scraping the local jvm\r\n- Scraping a remote jvm\r\n- The existing output format by default (mostly, escaping is a bit safer, and it doesn't assume 'type' is the first beanProperty)\r\n- Customising the name, help and labels as needed\r\n- Exporting only what you want (only whitelist right now, blacklist would be easy to add)\r\n- The java simpleclient\r\n\r\nA config of \r\n  { \"hostpost\": \"localhost:1234\",\r\n    \"rules\": [\r\n      {\"^java\"}\r\n    ]}\r\nwould export everything under java, with the default (i.e. existing) format.\r\n\r\n\r\n\r\nI haven't written tests or the servlet bit yet, but wanted to get initial feedback on the approach.\r\nIt also puts out a metric per sample too rather than combining metrics with the same name, which isn't correct.","created_at":"2014-12-08T18:01:31Z","updated_at":"2015-01-15T11:20:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0eb9be28da283c0dbd0561f7c7354c9b90cf2b1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/4/commits","review_comments_url":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/4/comments","review_comment_url":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/comments/{number}","comments_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/4/comments","statuses_url":"https://api.github.com/repos/prometheus/jmx_exporter/statuses/2ae55c8d03b6596588c2b18ecba37ada93544aaa","head":{"label":"brian-brazil:simpleclient","ref":"simpleclient","sha":"2ae55c8d03b6596588c2b18ecba37ada93544aaa","user":{"login":"brian-brazil","id":7115638,"avatar_url":"https://avatars.githubusercontent.com/u/7115638?v=3","gravatar_id":"","url":"https://api.github.com/users/brian-brazil","html_url":"https://github.com/brian-brazil","followers_url":"https://api.github.com/users/brian-brazil/followers","following_url":"https://api.github.com/users/brian-brazil/following{/other_user}","gists_url":"https://api.github.com/users/brian-brazil/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-brazil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-brazil/subscriptions","organizations_url":"https://api.github.com/users/brian-brazil/orgs","repos_url":"https://api.github.com/users/brian-brazil/repos","events_url":"https://api.github.com/users/brian-brazil/events{/privacy}","received_events_url":"https://api.github.com/users/brian-brazil/received_events","type":"User","site_admin":false},"repo":{"id":27727318,"name":"jmx_exporter","full_name":"brian-brazil/jmx_exporter","owner":{"login":"brian-brazil","id":7115638,"avatar_url":"https://avatars.githubusercontent.com/u/7115638?v=3","gravatar_id":"","url":"https://api.github.com/users/brian-brazil","html_url":"https://github.com/brian-brazil","followers_url":"https://api.github.com/users/brian-brazil/followers","following_url":"https://api.github.com/users/brian-brazil/following{/other_user}","gists_url":"https://api.github.com/users/brian-brazil/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-brazil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-brazil/subscriptions","organizations_url":"https://api.github.com/users/brian-brazil/orgs","repos_url":"https://api.github.com/users/brian-brazil/repos","events_url":"https://api.github.com/users/brian-brazil/events{/privacy}","received_events_url":"https://api.github.com/users/brian-brazil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brian-brazil/jmx_exporter","description":"A process for exposing JMX Beans in JSON format for prometheus to scrape","fork":true,"url":"https://api.github.com/repos/brian-brazil/jmx_exporter","forks_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/forks","keys_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/teams","hooks_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/hooks","issue_events_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/issues/events{/number}","events_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/events","assignees_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/assignees{/user}","branches_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/branches{/branch}","tags_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/tags","blobs_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/languages","stargazers_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/stargazers","contributors_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/contributors","subscribers_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/subscribers","subscription_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/subscription","commits_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/issues/comments/{number}","contents_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/contents/{+path}","compare_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/merges","archive_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/downloads","issues_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/issues{/number}","pulls_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/labels{/name}","releases_url":"https://api.github.com/repos/brian-brazil/jmx_exporter/releases{/id}","created_at":"2014-12-08T17:52:08Z","updated_at":"2014-12-08T17:52:09Z","pushed_at":"2015-01-15T11:15:33Z","git_url":"git://github.com/brian-brazil/jmx_exporter.git","ssh_url":"git@github.com:brian-brazil/jmx_exporter.git","clone_url":"https://github.com/brian-brazil/jmx_exporter.git","svn_url":"https://github.com/brian-brazil/jmx_exporter","homepage":null,"size":933,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prometheus:master","ref":"master","sha":"110ec014d2c8ba38b28472f3758b72a47191791a","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":17170044,"name":"jmx_exporter","full_name":"prometheus/jmx_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/jmx_exporter","description":"A process for exposing JMX Beans in JSON format for prometheus to scrape","fork":false,"url":"https://api.github.com/repos/prometheus/jmx_exporter","forks_url":"https://api.github.com/repos/prometheus/jmx_exporter/forks","keys_url":"https://api.github.com/repos/prometheus/jmx_exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/jmx_exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/jmx_exporter/teams","hooks_url":"https://api.github.com/repos/prometheus/jmx_exporter/hooks","issue_events_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/jmx_exporter/events","assignees_url":"https://api.github.com/repos/prometheus/jmx_exporter/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/jmx_exporter/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/jmx_exporter/tags","blobs_url":"https://api.github.com/repos/prometheus/jmx_exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/jmx_exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/jmx_exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/jmx_exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/jmx_exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/jmx_exporter/languages","stargazers_url":"https://api.github.com/repos/prometheus/jmx_exporter/stargazers","contributors_url":"https://api.github.com/repos/prometheus/jmx_exporter/contributors","subscribers_url":"https://api.github.com/repos/prometheus/jmx_exporter/subscribers","subscription_url":"https://api.github.com/repos/prometheus/jmx_exporter/subscription","commits_url":"https://api.github.com/repos/prometheus/jmx_exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/jmx_exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/jmx_exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/comments/{number}","contents_url":"https://api.github.com/repos/prometheus/jmx_exporter/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/jmx_exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/jmx_exporter/merges","archive_url":"https://api.github.com/repos/prometheus/jmx_exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/jmx_exporter/downloads","issues_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/jmx_exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/jmx_exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/jmx_exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/jmx_exporter/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/jmx_exporter/releases{/id}","created_at":"2014-02-25T10:55:39Z","updated_at":"2014-12-01T15:12:17Z","pushed_at":"2014-04-01T15:46:00Z","git_url":"git://github.com/prometheus/jmx_exporter.git","ssh_url":"git@github.com:prometheus/jmx_exporter.git","clone_url":"https://github.com/prometheus/jmx_exporter.git","svn_url":"https://github.com/prometheus/jmx_exporter","homepage":null,"size":1004,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/4"},"html":{"href":"https://github.com/prometheus/jmx_exporter/pull/4"},"issue":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/issues/4"},"comments":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/jmx_exporter/statuses/2ae55c8d03b6596588c2b18ecba37ada93544aaa"}}}}