Commit ed307897 by Ryan McKinley Committed by Arve Knudsen

Chore: remove expressions flag and allow (#22764)

(cherry picked from commit c65db9bf)
parent 1d63f57c
......@@ -19,10 +19,6 @@ import (
// QueryMetricsV2 returns query metrics
// POST /api/ds/query DataSource query w/ expressions
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 {
return Error(500, "No queries found in query", nil)
}
......@@ -76,6 +72,10 @@ func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricReq
return Error(500, "Metric request error", err)
}
} else {
if !setting.IsExpressionsEnabled() {
return Error(404, "Expressions feature toggle is not enabled", nil)
}
resp, err = plugins.Transform.Transform(c.Req.Context(), request)
if err != nil {
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