lib/storage: print __name__ instead of empty string in user-visible tag filters

This commit is contained in:
Aliaksandr Valialkin 2019-12-03 14:18:08 +02:00
parent 625f6ca761
commit c04f60db35

View file

@ -136,7 +136,11 @@ func (tf *tagFilter) String() string {
} else if tf.isRegexp {
op = "=~"
}
return fmt.Sprintf("%s%s%q", tf.key, op, tf.value)
key := tf.key
if len(key) == 0 {
key = []byte("__name__")
}
return fmt.Sprintf("%s%s%q", key, op, tf.value)
}
func (tf *tagFilter) Marshal(dst []byte, accountID, projectID uint32) []byte {