diff --git a/app/vmselect/netstorage/netstorage.go b/app/vmselect/netstorage/netstorage.go index 2f5aa59dd8..4cddeb5f55 100644 --- a/app/vmselect/netstorage/netstorage.go +++ b/app/vmselect/netstorage/netstorage.go @@ -567,12 +567,6 @@ func GetGraphiteTags(at *auth.Token, denyPartialResponse bool, filter string, li if err != nil { return nil, false, err } - if len(filter) > 0 { - labels, err = applyGraphiteRegexpFilter(filter, labels) - if err != nil { - return nil, false, err - } - } // Substitute "__name__" with "name" for Graphite compatibility for i := range labels { if labels[i] == "__name__" { @@ -581,6 +575,12 @@ func GetGraphiteTags(at *auth.Token, denyPartialResponse bool, filter string, li break } } + if len(filter) > 0 { + labels, err = applyGraphiteRegexpFilter(filter, labels) + if err != nil { + return nil, false, err + } + } if limit > 0 && limit < len(labels) { labels = labels[:limit] }