mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00: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
18af31a4c2
commit
5701b2f7bb
1 changed files with 6 additions and 2 deletions
|
@ -283,10 +283,14 @@ func labelValuesWithMatches(labelName string, matches []string, start, end int64
|
|||
if err != nil {
|
||||
return nil, 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 a new issue