mirror of
https://github.com/prometheus/prometheus.git
synced 2026-06-09 08:32:26 -04:00
Merge pull request #17668 from prometheus/fix-cmpop-many-to-one-tracking
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
PromQL: Fix insufficient cardinality checking for filter ops
This commit is contained in:
commit
19b794579b
2 changed files with 27 additions and 4 deletions
|
|
@ -2936,17 +2936,15 @@ func (ev *evaluator) VectorBinop(op parser.ItemType, lhs, rhs Vector, matching *
|
|||
if info != nil {
|
||||
lastErr = info
|
||||
}
|
||||
switch {
|
||||
case returnBool:
|
||||
if returnBool {
|
||||
histogramValue = nil
|
||||
if keep {
|
||||
floatValue = 1.0
|
||||
} else {
|
||||
floatValue = 0.0
|
||||
}
|
||||
case !keep:
|
||||
continue
|
||||
}
|
||||
|
||||
metric := resultMetric(ls.Metric, rs.Metric, op, matching, enh)
|
||||
if !ev.enableDelayedNameRemoval && returnBool {
|
||||
metric = metric.DropReserved(schema.IsMetadataLabel)
|
||||
|
|
@ -2972,6 +2970,10 @@ func (ev *evaluator) VectorBinop(op parser.ItemType, lhs, rhs Vector, matching *
|
|||
insertedSigs[insertSig] = struct{}{}
|
||||
}
|
||||
|
||||
if !keep && !returnBool {
|
||||
continue
|
||||
}
|
||||
|
||||
enh.Out = append(enh.Out, Sample{
|
||||
Metric: metric,
|
||||
F: floatValue,
|
||||
|
|
|
|||
21
promql/promqltest/testdata/operators.test
vendored
21
promql/promqltest/testdata/operators.test
vendored
|
|
@ -316,6 +316,27 @@ eval instant at 5m http_requests_histogram == http_requests_histogram
|
|||
eval instant at 5m http_requests_histogram != http_requests_histogram
|
||||
expect no_info
|
||||
|
||||
clear
|
||||
|
||||
# Check that we track many-to-one vector matching errors even when all but 0 or 1
|
||||
# series on the "many" side are filtered away.
|
||||
load 5m
|
||||
many_side{label="foo",job="test"} 0
|
||||
many_side{label="bar",job="test"} 1
|
||||
one_side{job="test"} 1
|
||||
|
||||
# Check 0 series surviving the filtering producing an error.
|
||||
eval instant at 0m many_side > on(job) one_side
|
||||
expect fail
|
||||
|
||||
# Check 1 series surviving the filtering producing an error.
|
||||
eval instant at 0m many_side >= on(job) one_side
|
||||
expect fail
|
||||
|
||||
# Check 2 series surviving the filtering producing an error.
|
||||
eval instant at 0m many_side <= on(job) one_side
|
||||
expect fail
|
||||
|
||||
# group_left/group_right.
|
||||
|
||||
clear
|
||||
|
|
|
|||
Loading…
Reference in a new issue