mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
app/vmselect/prometheus: return __name__
label if match[]
query to /api/v1/labels
matches at least a single time series
This commit is contained in:
parent
27a417bcd3
commit
3c1434118e
@ -812,6 +812,9 @@ func labelsWithMatches(matches []string, start, end int64, deadline searchutils.
|
||||
m[string(tag.Key)] = struct{}{}
|
||||
}
|
||||
}
|
||||
if len(mns) > 0 {
|
||||
m["__name__"] = struct{}{}
|
||||
}
|
||||
} else {
|
||||
rss, err := netstorage.ProcessSearchQuery(sq, false, deadline)
|
||||
if err != nil {
|
||||
@ -831,7 +834,6 @@ func labelsWithMatches(matches []string, start, end int64, deadline searchutils.
|
||||
return nil, fmt.Errorf("error when data fetching: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
labels := make([]string, 0, len(m))
|
||||
for label := range m {
|
||||
labels = append(labels, label)
|
||||
|
Loading…
Reference in New Issue
Block a user