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 ade453847f
commit efbc83a13e

View File

@ -124,7 +124,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)
}
// Marshal appends marshaled tf to dst