Commit c65db9bf by Ryan McKinley Committed by GitHub

Chore: remove expressions flag and allow (#22764)

parent 31789466
...@@ -19,10 +19,6 @@ import ( ...@@ -19,10 +19,6 @@ import (
// QueryMetricsV2 returns query metrics // QueryMetricsV2 returns query metrics
// POST /api/ds/query DataSource query w/ expressions // POST /api/ds/query DataSource query w/ expressions
func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricRequest) Response { func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricRequest) Response {
if !setting.IsExpressionsEnabled() {
return Error(404, "Expressions feature toggle is not enabled", nil)
}
if len(reqDto.Queries) == 0 { if len(reqDto.Queries) == 0 {
return Error(500, "No queries found in query", nil) return Error(500, "No queries found in query", nil)
} }
...@@ -76,6 +72,10 @@ func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricReq ...@@ -76,6 +72,10 @@ func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricReq
return Error(500, "Metric request error", err) return Error(500, "Metric request error", err)
} }
} else { } else {
if !setting.IsExpressionsEnabled() {
return Error(404, "Expressions feature toggle is not enabled", nil)
}
resp, err = plugins.Transform.Transform(c.Req.Context(), request) resp, err = plugins.Transform.Transform(c.Req.Context(), request)
if err != nil { if err != nil {
return Error(500, "Transform request error", err) return Error(500, "Transform request error", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment