mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-31 20:30:37 +00:00
fix: validate matcher op for __name__ in promql (#5191)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -689,6 +689,13 @@ impl PromPlanner {
|
||||
let mut matches = label_matchers.find_matchers(METRIC_NAME);
|
||||
ensure!(!matches.is_empty(), NoMetricMatcherSnafu);
|
||||
ensure!(matches.len() == 1, MultipleMetricMatchersSnafu);
|
||||
ensure!(
|
||||
matches[0].op == MatchOp::Equal,
|
||||
UnsupportedMatcherOpSnafu {
|
||||
matcher_op: matches[0].op.to_string(),
|
||||
matcher: METRIC_NAME
|
||||
}
|
||||
);
|
||||
metric_name = matches.pop().map(|m| m.value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user