{"action":"created","issue":{"url":"https://api.github.com/repos/rackerlabs/blueflood/issues/521","labels_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/521/labels{/name}","comments_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/521/comments","events_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/521/events","html_url":"https://github.com/rackerlabs/blueflood/pull/521","id":106880312,"number":521,"title":"support enum values in ElasticSearch","user":{"login":"VinnyQ","id":203223,"avatar_url":"https://avatars.githubusercontent.com/u/203223?v=3","gravatar_id":"","url":"https://api.github.com/users/VinnyQ","html_url":"https://github.com/VinnyQ","followers_url":"https://api.github.com/users/VinnyQ/followers","following_url":"https://api.github.com/users/VinnyQ/following{/other_user}","gists_url":"https://api.github.com/users/VinnyQ/gists{/gist_id}","starred_url":"https://api.github.com/users/VinnyQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VinnyQ/subscriptions","organizations_url":"https://api.github.com/users/VinnyQ/orgs","repos_url":"https://api.github.com/users/VinnyQ/repos","events_url":"https://api.github.com/users/VinnyQ/events{/privacy}","received_events_url":"https://api.github.com/users/VinnyQ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-16T22:52:11Z","updated_at":"2015-09-21T19:37:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/521","html_url":"https://github.com/rackerlabs/blueflood/pull/521","diff_url":"https://github.com/rackerlabs/blueflood/pull/521.diff","patch_url":"https://github.com/rackerlabs/blueflood/pull/521.patch"},"body":"WHAT:  Add search capability for blueflood so that users can pass in the param \"include_enum_values\" and be able to retrieve enum values along with the metric names in the result when hitting the /v2.0/:tenantId/metrics/search endpoint.\r\n(see story:  https://jira.rax.io/browse/CMD-741;  Note -- I do not think we should implement the enum version of the DiscoveryWriter class in this story, but should move the writing of that class to the rollup story where the new index will actually be created during rollup).\r\n\r\nHOW:\r\n- extract ElasticIO.Discovery inner class to standalone Discovery class\r\n- extract ElasticIO.ESFieldLabel enum to standalone enum class\r\n- add configs for enums elasticsearch module\r\n- add EnumElasticIO class with insertDiscovery() and search() methods.\r\n- modify SearchResult to store enum values field\r\n- modify HttpMetricsIndexHandler to check for include_enum_values\r\n- modify HttpMetricsIndexHandler to include enum values in json result\r\n\r\nPlease refer to the new \"enums\" index mapping for the index and its fields to be created by metrics rollup of enum values:  https://github.com/VinnyQ/blueflood-chef/blob/add_elasticsearch_mappings_for_enums/site-cookbooks/old-elasticsearch/files/default/enums.json\r\n\r\nNOTE:  This deploy will need changes to blueflood.conf (after the code is merged)\r\nTo add the following property:\r\n```\r\nENUMS_DISCOVERY_MODULES=com.rackspacecloud.blueflood.io.EnumElasticIO\r\n```\r\n(do this in https://github.com/rackerlabs/blueflood-chef).\r\n\r\nAnd also we will have to create another ElasticSearch alias \"metric_metadata_read\" that also points to the new \"enums\" index.  The code to do so is:\r\n\r\n```\r\ncurl -XPOST 'http://localhost:9200/_aliases' -d '\r\n{\r\n    \"actions\" : [\r\n        { \"add\" : { \"index\" : \"enums\", \"alias\" : \"metric_metadata_read\" } }\r\n    ]\r\n}'\r\n```"},"comment":{"url":"https://api.github.com/repos/rackerlabs/blueflood/issues/comments/142087221","html_url":"https://github.com/rackerlabs/blueflood/pull/521#issuecomment-142087221","issue_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/521","id":142087221,"user":{"login":"GeorgeJahad","id":86830,"avatar_url":"https://avatars.githubusercontent.com/u/86830?v=3","gravatar_id":"","url":"https://api.github.com/users/GeorgeJahad","html_url":"https://github.com/GeorgeJahad","followers_url":"https://api.github.com/users/GeorgeJahad/followers","following_url":"https://api.github.com/users/GeorgeJahad/following{/other_user}","gists_url":"https://api.github.com/users/GeorgeJahad/gists{/gist_id}","starred_url":"https://api.github.com/users/GeorgeJahad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeorgeJahad/subscriptions","organizations_url":"https://api.github.com/users/GeorgeJahad/orgs","repos_url":"https://api.github.com/users/GeorgeJahad/repos","events_url":"https://api.github.com/users/GeorgeJahad/events{/privacy}","received_events_url":"https://api.github.com/users/GeorgeJahad/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T19:37:12Z","updated_at":"2015-09-21T19:37:12Z","body":"+1"}}