mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Clarify error message around on(x) group_left(x)
This commit is contained in:
parent
7201c010c4
commit
68e70d992a
|
@ -235,7 +235,7 @@ type VectorMatching struct {
|
||||||
// rather than only using them.
|
// rather than only using them.
|
||||||
Ignoring bool
|
Ignoring bool
|
||||||
// Include contains additional labels that should be included in
|
// Include contains additional labels that should be included in
|
||||||
// the result from the side with the higher cardinality.
|
// the result from the side with the lower cardinality.
|
||||||
Include model.LabelNames
|
Include model.LabelNames
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -486,7 +486,7 @@ func (p *parser) expr() Expr {
|
||||||
for _, ln := range vecMatching.MatchingLabels {
|
for _, ln := range vecMatching.MatchingLabels {
|
||||||
for _, ln2 := range vecMatching.Include {
|
for _, ln2 := range vecMatching.Include {
|
||||||
if ln == ln2 && !vecMatching.Ignoring {
|
if ln == ln2 && !vecMatching.Ignoring {
|
||||||
p.errorf("label %q must not occur in ON and INCLUDE clause at once", ln)
|
p.errorf("label %q must not occur in ON and GROUP clause at once", ln)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -757,7 +757,7 @@ var testExpr = []struct {
|
||||||
}, {
|
}, {
|
||||||
input: `http_requests{group="production"} + on(instance) group_left(job,instance) cpu_count{type="smp"}`,
|
input: `http_requests{group="production"} + on(instance) group_left(job,instance) cpu_count{type="smp"}`,
|
||||||
fail: true,
|
fail: true,
|
||||||
errMsg: "label \"instance\" must not occur in ON and INCLUDE clause at once",
|
errMsg: "label \"instance\" must not occur in ON and GROUP clause at once",
|
||||||
}, {
|
}, {
|
||||||
input: "foo + bool bar",
|
input: "foo + bool bar",
|
||||||
fail: true,
|
fail: true,
|
||||||
|
|
Loading…
Reference in a new issue