mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
app/vmselect/prometheus: properly pass filter for labelName=__name__
in labelValuesWithMatches
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/343
This commit is contained in:
parent
cf9aee4ec3
commit
8fa1cd24d8
@ -340,10 +340,14 @@ func labelValuesWithMatches(at *auth.Token, labelName string, matches []string,
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
// Add `labelName!=''` tag filter in order to filter out series without the labelName.
|
||||
key := []byte(labelName)
|
||||
if string(key) == "__name__" {
|
||||
key = nil
|
||||
}
|
||||
for i, tfs := range tagFilterss {
|
||||
// Add `labelName!=''` tag filter in order to filter out series without the labelName.
|
||||
tagFilterss[i] = append(tfs, storage.TagFilter{
|
||||
Key: []byte(labelName),
|
||||
Key: key,
|
||||
IsNegative: true,
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user