Skip to content

Commit d4b0e75

Browse files
authored
Remove hardcoding for middleware checking for access to PromQL experimental functions (#10183)
1 parent 4ecfd4c commit d4b0e75

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/frontend/querymiddleware/experimental_functions.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ func containedExperimentalFunctions(expr parser.Expr) map[string]struct{} {
100100
}
101101
agg, ok := node.(*parser.AggregateExpr)
102102
if ok {
103-
// Note that unlike most PromQL functions, the experimental nature of the aggregation functions are manually
104-
// defined and enforced, so they have to be hardcoded here and updated along with changes in Prometheus.
105-
switch agg.Op {
106-
case parser.LIMITK, parser.LIMIT_RATIO:
103+
if agg.Op.IsExperimentalAggregator() {
107104
expFuncNames[agg.Op.String()] = struct{}{}
108105
}
109106
}

0 commit comments

Comments
 (0)