graphite-remote-adapter
graphite-remote-adapter copied to clipboard
Fix: EnableTags=true and FilteredTags="" produces dot separated result
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.
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
}