Closed brushek closed 4 years ago
The adapter use go-modules. From your logs, it seems that Go disable it.
Can you try with:
export GO111MODULE="on"
After export GO111MODULE="on"
I could compile source code, but then - after running graphite-remote-adapter
I get:
./graphite-remote-adapter
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x78a2db]
goroutine 1 [running]:
github.com/prometheus/common/promlog.New(0xc0001c1f18, 0xb, 0xc0001d2840)
/root/go/pkg/mod/github.com/prometheus/common@v0.7.0/promlog/log.go:97 +0x3b
main.main()
/root/go/src/github.com/criteo/graphite-remote-adapter/cmd/graphite-remote-adapter/main.go:68 +0x75
the format in promlog has changed, following change resolve problem:
diff --git a/cmd/graphite-remote-adapter/main.go b/cmd/graphite-remote-adapter/main.go
index 9f05785..b614f50 100644
--- a/cmd/graphite-remote-adapter/main.go
+++ b/cmd/graphite-remote-adapter/main.go
@@ -65,7 +65,7 @@ func reload(cliCfg *config.Config, logger log.Logger) (*config.Config, error) {
func main() {
cliCfg := config.ParseCommandLine()
- logger := promlog.New(&promlog.Config{Level: &cliCfg.LogLevel})
+ logger := promlog.New(&promlog.Config{Level: &cliCfg.LogLevel, Format: &promlog.AllowedFormat{}})
level.Info(logger).Log("msg", "Starting graphite-remote-adapter", "version", version.Info())
level.Info(logger).Log("build_context", version.BuildContext())
Thanks for the fix! They were included in the main tree.
I'm trying to use this adapter, but can't build it: