mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
Fix missing printed keep_common without grouping.
This commit is contained in:
parent
096a2ef200
commit
6ac39700ea
|
@ -143,10 +143,10 @@ func (node *AggregateExpr) String() string {
|
|||
} else {
|
||||
format = "%s BY (%s)"
|
||||
}
|
||||
if node.KeepExtraLabels {
|
||||
format += " KEEP_COMMON"
|
||||
aggrString = fmt.Sprintf(format, aggrString, node.Grouping)
|
||||
}
|
||||
return fmt.Sprintf(format, aggrString, node.Grouping)
|
||||
if node.KeepExtraLabels {
|
||||
aggrString += " KEEP_COMMON"
|
||||
}
|
||||
return aggrString
|
||||
}
|
||||
|
|
|
@ -30,6 +30,9 @@ func TestExprString(t *testing.T) {
|
|||
{
|
||||
in: `sum(task:errors:rate10s{job="s"}) BY (code) KEEP_COMMON`,
|
||||
},
|
||||
{
|
||||
in: `sum(task:errors:rate10s{job="s"}) KEEP_COMMON`,
|
||||
},
|
||||
{
|
||||
in: `sum(task:errors:rate10s{job="s"}) WITHOUT (instance)`,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue