{"action":"opened","issue":{"url":"https://api.github.com/repos/Braedon/prometheus-es-exporter/issues/5","repository_url":"https://api.github.com/repos/Braedon/prometheus-es-exporter","labels_url":"https://api.github.com/repos/Braedon/prometheus-es-exporter/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/Braedon/prometheus-es-exporter/issues/5/comments","events_url":"https://api.github.com/repos/Braedon/prometheus-es-exporter/issues/5/events","html_url":"https://github.com/Braedon/prometheus-es-exporter/issues/5","id":174674868,"number":5,"title":"More example for instrument metrics name and label on export.cfg","user":{"login":"zanhsieh","id":283101,"avatar_url":"https://avatars.githubusercontent.com/u/283101?v=3","gravatar_id":"","url":"https://api.github.com/users/zanhsieh","html_url":"https://github.com/zanhsieh","followers_url":"https://api.github.com/users/zanhsieh/followers","following_url":"https://api.github.com/users/zanhsieh/following{/other_user}","gists_url":"https://api.github.com/users/zanhsieh/gists{/gist_id}","starred_url":"https://api.github.com/users/zanhsieh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanhsieh/subscriptions","organizations_url":"https://api.github.com/users/zanhsieh/orgs","repos_url":"https://api.github.com/users/zanhsieh/repos","events_url":"https://api.github.com/users/zanhsieh/events{/privacy}","received_events_url":"https://api.github.com/users/zanhsieh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-02T03:48:59Z","updated_at":"2016-09-02T03:48:59Z","closed_at":null,"body":"Hi,\r\n\r\nJust curious, what should i do if I'd like to let Prometheus metrics coming out with label or custom name?\r\n\r\nTo demo this, suppose I have following defined in exporter.cfg:\r\n\r\n    [query_all]\r\n    # How often to run this query.\r\n    QueryIntervalSecs = 5\r\n    # The indices to run the query on. Any way of specifying indices supported by your Elasticsearch version can be used.\r\n    # This key is optional - if not specified, the default is '_all'.\r\n    QueryIndices = _all\r\n    # The search query to run.\r\n    QueryJson = { \"size\": 0, \"query\": { \"match_all\": {} } }\r\n\r\n    [query_login]\r\n    QueryIntervalSecs = 20\r\n    QueryIndices = _all\r\n    QueryJson = { \"query\": { \"query_string\": { \"query\": \"path: \\\"*login\\\" AND method: \\\"GET\\\" AND status:\\\"200\\\"\" } } }\r\n\r\n\r\nSo Prometheus metrics come out with:\r\n\r\n```\r\n# HELP login_hits \r\n# TYPE login_hits gauge\r\nlogin_hits 1756.0\r\n...\r\n...\r\n# HELP all_hits \r\n# TYPE all_hits gauge\r\nall_hits 18923.0\r\n```\r\n\r\nNow what should I change on \"[query_login]\" in order to get like below?\r\n\r\n```\r\nlogin_hits{method:\"GET\", status=\"200\"} 1756.0\r\n```\r\n\r\nAlso, what should I change on exporter.cfg in order to get like this below?\r\n\r\n```\r\navg_req_size{path=\"/login\", method:\"GET\", status=\"200\"} 1234.5\r\navg_resp_size{path=\"/login\", method:\"GET\", status=\"200\"} 1234.5\r\n```\r\n\r\nThanks."}}
{"actor":{"display_login":"zanhsieh"}}