mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00: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
852aed62f7
commit
2f4421b86c
1 changed files with 3 additions and 1 deletions
|
@ -886,6 +886,9 @@ func labelsWithMatches(at *auth.Token, denyPartialResponse bool, matches []strin
|
|||
m[string(tag.Key)] = struct{}{}
|
||||
}
|
||||
}
|
||||
if len(mns) > 0 {
|
||||
m["__name__"] = struct{}{}
|
||||
}
|
||||
} else {
|
||||
rss, isPartialResponse, err := netstorage.ProcessSearchQuery(at, denyPartialResponse, sq, false, deadline)
|
||||
if err != nil {
|
||||
|
@ -906,7 +909,6 @@ func labelsWithMatches(at *auth.Token, denyPartialResponse bool, matches []strin
|
|||
return nil, false, 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 a new issue