drop metric name for bool modifier (#3821)

fixes #3820
This commit is contained in:
Krasi Georgiev 2018-02-11 18:15:55 +02:00 committed by Brian Brazil
parent dfdd2cb5f4
commit a53d4ed197
2 changed files with 4 additions and 1 deletions

View File

@ -1151,7 +1151,7 @@ func (ev *evaluator) VectorscalarBinop(op itemType, lhs Vector, rhs Scalar, swap
}
if keep {
lhsSample.V = value
if shouldDropMetricName(op) {
if shouldDropMetricName(op) || returnBool {
lhsSample.Metric = dropMetricName(lhsSample.Metric)
}
vec = append(vec, lhsSample)

View File

@ -236,6 +236,9 @@ eval instant at 50m 0 == bool 1
eval instant at 50m 1 == bool 1
1
eval instant at 50m http_requests{job="api-server", instance="0", group="production"} == bool 100
{job="api-server", instance="0", group="production"} 1
# group_left/group_right.
clear