Clarify error message around on(x) group_left(x)

This commit is contained in:
Brian Brazil 2016-04-26 14:31:00 +01:00
parent 7201c010c4
commit 68e70d992a
3 changed files with 3 additions and 3 deletions

View File

@ -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
}

View File

@ -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)
}
}
}

View File

@ -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,