From 59fb75717e35f240254544253e1ebd76a468e8a1 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 16 Nov 2020 15:50:48 +0200 Subject: [PATCH] app/vmselect/netstorage: apply Graphite filter after substituting `__name__` with `name` --- app/vmselect/netstorage/netstorage.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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] }