fix(prom): align remote read label matcher semantics (#9633)

* fix(prom): align remote read label matcher semantics

Signed-off-by: fys <fengys1996@gmail.com>

* chore: optimize comment of validate_matchers

* fix(prom): preserve existing binary label regex handling

Signed-off-by: fys <fengys1996@gmail.com>

* refactor: condition

* test(prom): simplify remote read matcher tests and clarify comments

* fix(prom): return binary remote read labels as UTF-8

* fix(prom): reject binary labels in remote read

* refactor(prom): align remote read null label handling with PromQL

Signed-off-by: fys <fengys1996@gmail.com>

* refactor(prom): simplify null handling in label matcher branches

Signed-off-by: fys <fengys1996@gmail.com>

* fix(prom): restrict remote read labels to string types

Signed-off-by: fys <fengys1996@gmail.com>

* test(prom): use string label in default value column test

Signed-off-by: fys <fengys1996@gmail.com>

* fix: code review

---------

Signed-off-by: fys <fengys1996@gmail.com>
This commit is contained in:
fys
2026-10-19 06:58:40 +00:00
committed by GitHub
parent cca95b2637
commit 4e8bc6df86
5 changed files with 389 additions and 28 deletions
+6
View File
@@ -708,6 +708,12 @@ mod tests {
(MatcherType::Neq as i32, "[", 200),
(MatcherType::Re as i32, "spark", 200),
(MatcherType::Nre as i32, "api.*", 200),
(MatcherType::Re as i32, "(?x) spark", 200),
(MatcherType::Nre as i32, "(?x) spark", 200),
(MatcherType::Re as i32, "(?x) spark # comment", 400),
(MatcherType::Nre as i32, "(?x) spark # comment", 400),
(MatcherType::Re as i32, "a)|(?:b", 400),
(MatcherType::Nre as i32, "a)|(?:b", 400),
] {
let mut query = remote_query(metric);
query.matchers.push(LabelMatcher {