{"action":"opened","issue":{"url":"https://api.github.com/repos/grafana/grafana/issues/5148","repository_url":"https://api.github.com/repos/grafana/grafana","labels_url":"https://api.github.com/repos/grafana/grafana/issues/5148/labels{/name}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/5148/comments","events_url":"https://api.github.com/repos/grafana/grafana/issues/5148/events","html_url":"https://github.com/grafana/grafana/issues/5148","id":156449216,"number":5148,"title":"[Bug] Elasticsearch Datasource: Order By Percentiles fails","user":{"login":"felixbarny","id":2163464,"avatar_url":"https://avatars.githubusercontent.com/u/2163464?v=3","gravatar_id":"","url":"https://api.github.com/users/felixbarny","html_url":"https://github.com/felixbarny","followers_url":"https://api.github.com/users/felixbarny/followers","following_url":"https://api.github.com/users/felixbarny/following{/other_user}","gists_url":"https://api.github.com/users/felixbarny/gists{/gist_id}","starred_url":"https://api.github.com/users/felixbarny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixbarny/subscriptions","organizations_url":"https://api.github.com/users/felixbarny/orgs","repos_url":"https://api.github.com/users/felixbarny/repos","events_url":"https://api.github.com/users/felixbarny/events{/privacy}","received_events_url":"https://api.github.com/users/felixbarny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-24T08:33:00Z","updated_at":"2016-05-24T08:33:00Z","closed_at":null,"body":"**What Grafana version**\r\n3.0.2\r\n\r\n**What datasource**\r\nElasticsearch\r\n\r\n**What did you do?**\r\n* Go to http://play.grafana.org/dashboard/db/elasticsearch-metrics?panelId=1&fullscreen&edit\r\n* Edit metric to percentile and set percentiles to 99\r\n* Modify Order By of `@hostname` terms aggregation -> set to `Percentiles @value`\r\n![orderbypercentiles](https://cloud.githubusercontent.com/assets/2163464/15497221/e465433e-2199-11e6-8ca8-1094d7d6d191.png)\r\n\r\n\r\n**What was the expected result?**\r\nWhen only one percentile is entered, the aggregation order path should be set automatically (see error message below). When multiple percentiles are entered, the user should be able to choose one.\r\n\r\n**What happenend instead**\r\n\r\n```\r\n{\r\n    \"root_cause\": [\r\n        {\r\n            \"type\": \"aggregation_execution_exception\",\r\n            \"reason\": \"Invalid terms aggregation order path [1]. When ordering on a multi-value metrics aggregation a metric name must be specified\"\r\n        }\r\n    ],\r\n    \"type\": \"search_phase_execution_exception\",\r\n    \"reason\": \"all shards failed\",\r\n    \"phase\": \"query\",\r\n    \"grouped\": true,\r\n    \"failed_shards\": [\r\n        {\r\n            \"shard\": 0,\r\n            \"index\": \"metrics-2016.05.24\",\r\n            \"node\": \"Fs1eG42kRquwBzlAS_nB-w\",\r\n            \"reason\": {\r\n                \"type\": \"aggregation_execution_exception\",\r\n                \"reason\": \"Invalid terms aggregation order path [1]. When ordering on a multi-value metrics aggregation a metric name must be specified\"\r\n            }\r\n        }\r\n    ]\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"felixbarny"}}