{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/47","labels_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/47/comments","events_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/47/events","html_url":"https://github.com/prometheus/jmx_exporter/issues/47","id":122716080,"number":47,"title":"Export tags from mbeans","user":{"login":"bobrik","id":89186,"avatar_url":"https://avatars.githubusercontent.com/u/89186?v=3","gravatar_id":"","url":"https://api.github.com/users/bobrik","html_url":"https://github.com/bobrik","followers_url":"https://api.github.com/users/bobrik/followers","following_url":"https://api.github.com/users/bobrik/following{/other_user}","gists_url":"https://api.github.com/users/bobrik/gists{/gist_id}","starred_url":"https://api.github.com/users/bobrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobrik/subscriptions","organizations_url":"https://api.github.com/users/bobrik/orgs","repos_url":"https://api.github.com/users/bobrik/repos","events_url":"https://api.github.com/users/bobrik/events{/privacy}","received_events_url":"https://api.github.com/users/bobrik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-17T11:20:59Z","updated_at":"2015-12-17T11:33:41Z","closed_at":null,"body":"HBase exports tags for some mbeans:\r\n\r\n```json\r\n{\r\n    \"name\" : \"Hadoop:service=HBase,name=JvmMetrics\",\r\n    \"modelerType\" : \"JvmMetrics\",\r\n    \"tag.Context\" : \"jvm\",\r\n    \"tag.ProcessName\" : \"RegionServer\",\r\n    \"tag.SessionId\" : \"\",\r\n    \"tag.Hostname\" : \"pewpew\",\r\n    \"MemNonHeapUsedM\" : 93.03323,\r\n    \"MemNonHeapCommittedM\" : 94.578125,\r\n    \"MemNonHeapMaxM\" : -9.536743E-7,\r\n    \"MemHeapUsedM\" : 3626.3154,\r\n    \"MemHeapCommittedM\" : 5279.8945,\r\n    \"MemHeapMaxM\" : 8000.6875,\r\n    \"MemMaxM\" : 8000.6875,\r\n    \"GcCountParNew\" : 6348,\r\n    \"GcTimeMillisParNew\" : 177628,\r\n    \"GcCountConcurrentMarkSweep\" : 13,\r\n    \"GcTimeMillisConcurrentMarkSweep\" : 698,\r\n    \"GcCount\" : 6361,\r\n    \"GcTimeMillis\" : 178326,\r\n    \"ThreadsNew\" : 0,\r\n    \"ThreadsRunnable\" : 20,\r\n    \"ThreadsBlocked\" : 0,\r\n    \"ThreadsWaiting\" : 69,\r\n    \"ThreadsTimedWaiting\" : 26,\r\n    \"ThreadsTerminated\" : 0,\r\n    \"LogFatal\" : 0,\r\n    \"LogError\" : 0,\r\n    \"LogWarn\" : 0,\r\n    \"LogInfo\" : 0\r\n  }\r\n```\r\n\r\nHere I'm interested in `tag.ProcessName` being `RegionServer`. For master server I care about `tag.isActiveMaster` being `true` or `false`.\r\n\r\nI'd like to have an ability to export these into labels somehow."},"comment":{"url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/comments/165430212","html_url":"https://github.com/prometheus/jmx_exporter/issues/47#issuecomment-165430212","issue_url":"https://api.github.com/repos/prometheus/jmx_exporter/issues/47","id":165430212,"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},"created_at":"2015-12-17T11:33:41Z","updated_at":"2015-12-17T11:33:41Z","body":"For ProcessName, I suspect you should be doing that as a target label from your service discovery rather than from the target itself.\r\n\r\nFor the others, what I was thinking is that you could define the value of a metric to also come from the regex. This would let you put a 1 in for it, and also pull a label out."}}