Query: do not require datasource name and id (#24718)

This commit is contained in:
Ryan McKinley 2020-05-14 20:05:16 -07:00 committed by GitHub
parent 6a0abf895e
commit b73d237bf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,10 +32,7 @@ func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricReq
expr := false
var ds *models.DataSource
for i, query := range reqDto.Queries {
name, err := query.Get("datasource").String()
if err != nil {
return Error(500, "datasource missing name", err)
}
name := query.Get("datasource").MustString("")
if name == "__expr__" {
expr = true
}