{"action":"opened","issue":{"url":"https://api.github.com/repos/grafana/grafana/issues/1601","labels_url":"https://api.github.com/repos/grafana/grafana/issues/1601/labels{/name}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/1601/comments","events_url":"https://api.github.com/repos/grafana/grafana/issues/1601/events","html_url":"https://github.com/grafana/grafana/issues/1601","id":61784842,"number":1601,"title":"OpenTSDB panel - Incorrect target for plotted curve","user":{"login":"saurabhagrawal-fk","id":8361495,"avatar_url":"https://avatars.githubusercontent.com/u/8361495?v=3","gravatar_id":"","url":"https://api.github.com/users/saurabhagrawal-fk","html_url":"https://github.com/saurabhagrawal-fk","followers_url":"https://api.github.com/users/saurabhagrawal-fk/followers","following_url":"https://api.github.com/users/saurabhagrawal-fk/following{/other_user}","gists_url":"https://api.github.com/users/saurabhagrawal-fk/gists{/gist_id}","starred_url":"https://api.github.com/users/saurabhagrawal-fk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saurabhagrawal-fk/subscriptions","organizations_url":"https://api.github.com/users/saurabhagrawal-fk/orgs","repos_url":"https://api.github.com/users/saurabhagrawal-fk/repos","events_url":"https://api.github.com/users/saurabhagrawal-fk/events{/privacy}","received_events_url":"https://api.github.com/users/saurabhagrawal-fk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-15T09:56:26Z","updated_at":"2015-03-15T09:56:26Z","closed_at":null,"body":"If an openTSDB graph panel with multiple metrics is created, and the openTSDB datasource returns a query set smaller than the number of queried metrics, then the panel's legend and tooltips are incorrect.\r\n\r\nAssume that the openTSDB's HTTP POST endpoint */api/query* is hit with payload \r\n```javascript\r\n{\r\n    \"start\": 1356998400,\r\n    \"end\": 1356998460,\r\n    \"queries\": [ Q1, Q2 ]\r\n}\r\n```\r\nThe response will typically look like: { [ R1, R2 ] }, which contains 2 data series - R1 corresponding to Q1, and R2 corresponding to Q2. \r\n\r\nHowever, if openTSDB has no data corresponding to Q1, but has data for Q2, then the response would be { [ R2 ] }. Grafana does not handle this case well. It plots the resultant data R2, but labels it wrongly with Q1's alias, instead of Q2's alias. This can result in very misleading dashboards."}}