Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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