lib/storage: do not show artifically created label for reverse Graphite labels at /api/v1/labels page

This commit is contained in:
Aliaksandr Valialkin 2020-11-16 00:41:43 +02:00
parent 2ac5f00d98
commit 9ec964bff8

View file

@ -744,6 +744,10 @@ func (db *indexDB) SearchTagKeysOnTimeRange(accountID, projectID uint32, tr Time
keys := make([]string, 0, len(tks))
for key := range tks {
if key == string(graphiteReverseTagKey) {
// Do not show artificially created graphiteReverseTagKey to the caller.
continue
}
// Do not skip empty keys, since they are converted to __name__
keys = append(keys, key)
}
@ -855,6 +859,10 @@ func (db *indexDB) SearchTagKeys(accountID, projectID uint32, maxTagKeys int, de
keys := make([]string, 0, len(tks))
for key := range tks {
if key == string(graphiteReverseTagKey) {
// Do not show artificially created graphiteReverseTagKey to the caller.
continue
}
// Do not skip empty keys, since they are converted to __name__
keys = append(keys, key)
}