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.
|
||||
Ignoring bool
|
||||
// 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
|
||||
}
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@ func (p *parser) expr() Expr {
|
|||
for _, ln := range vecMatching.MatchingLabels {
|
||||
for _, ln2 := range vecMatching.Include {
|
||||
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"}`,
|
||||
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",
|
||||
fail: true,
|
||||
|
|
Loading…
Reference in New Issue