diff --git a/lib/promrelabel/if_expression.go b/lib/promrelabel/if_expression.go index 6ae413efa1..78519d3e8a 100644 --- a/lib/promrelabel/if_expression.go +++ b/lib/promrelabel/if_expression.go @@ -141,7 +141,10 @@ func newIfExpression(s string) (*ifExpression, error) { // String returns string representation of ie. func (ie *IfExpression) String() string { if ie == nil { - return "[]" + return "{}" + } + if len(ie.ies) == 1 { + return ie.ies[0].String() } return fmt.Sprintf("%s", ie.ies) }