mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-28 04:02:21 -04:00
promql/parser: simplify BinaryExpr label formatting
Signed-off-by: ADITYA TIWARI <adityatiwari342005@gmail.com>
This commit is contained in:
parent
301b9eff44
commit
3a82dcc6c5
1 changed files with 2 additions and 9 deletions
|
|
@ -155,11 +155,7 @@ func (node *BinaryExpr) getMatchingStr() string {
|
|||
if vm.On {
|
||||
vmTag = "on"
|
||||
}
|
||||
// Format labels with proper UTF-8 quoting using writeLabels()
|
||||
b.Reset()
|
||||
b.WriteString(" ")
|
||||
b.WriteString(vmTag)
|
||||
b.WriteString(" (")
|
||||
b.WriteString(" " + vmTag + " (")
|
||||
writeLabels(&b, vm.MatchingLabels)
|
||||
b.WriteString(")")
|
||||
matching = b.String()
|
||||
|
|
@ -170,11 +166,8 @@ func (node *BinaryExpr) getMatchingStr() string {
|
|||
if vm.Card == CardManyToOne {
|
||||
vmCard = "left"
|
||||
}
|
||||
// Format labels with proper UTF-8 quoting using writeLabels()
|
||||
b.Reset()
|
||||
b.WriteString(" group_")
|
||||
b.WriteString(vmCard)
|
||||
b.WriteString(" (")
|
||||
b.WriteString(" group_" + vmCard + " (")
|
||||
writeLabels(&b, vm.Include)
|
||||
b.WriteString(")")
|
||||
matching += b.String()
|
||||
|
|
|
|||
Loading…
Reference in a new issue