Skip to content

Fix: EnableTags=true and FilteredTags="" produces dot separated result#79

Open
lexx-bright wants to merge 1 commit intocriteo:masterfrom
lexx-bright:master
Open

Fix: EnableTags=true and FilteredTags="" produces dot separated result#79
lexx-bright wants to merge 1 commit intocriteo:masterfrom
lexx-bright:master

Conversation

@lexx-bright
Copy link

Do not split empty string. Otherwise the result is a slice with one element - the empty string. The rest array length checks will consider we have tags to filter.

@msaf1980
Copy link

msaf1980 commented Sep 3, 2020

May be also add (for replace spaces if tags passed like "tag1, tag2" instead of "tag1,tag2" ?

diff --git a/cmd/graphite-remote-adapter/main.go b/cmd/graphite-remote-adapter/main.go
index b614f50..f84d484 100644
--- a/cmd/graphite-remote-adapter/main.go
+++ b/cmd/graphite-remote-adapter/main.go
@@ -18,6 +18,7 @@ import (
        _ "net/http/pprof"
        "os"
        "os/signal"
+       "strings"
        "syscall"
 
        "github.com/go-kit/kit/log"
@@ -59,6 +60,7 @@ func reload(cliCfg *config.Config, logger log.Logger) (*config.Config, error) {
                cfg.Write.Timeout = cliCfg.Write.Timeout
        }
 
+       cfg.Graphite.FilteredTags = strings.ReplaceAll(cfg.Graphite.FilteredTags, " ", "")
        return cfg, nil
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants