pwillie / prometheus-es-adapter

Prometheus remote storage adapter for Elasticsearch
Apache License 2.0
60 stars 31 forks source link

cannot use "go.uber.org/zap".Error(err) (type "go.uber.org/zap/zapcore".Field) #21

Open dallanic opened 5 years ago

dallanic commented 5 years ago

Operating System: Red Hat Enterprise Linux Server 7.5 (Maipo) go version go1.10.3 linux/amd64

I am trying to build but got the following error :

building prometheus-es-adapter nil GOPATH=/app/list/data/prometheus-es-adapter-master go build -ldflags "-X main.GitCommit=17483d1adb607e642c0c09dc34a477e028a57a56+CHANGES -X main.VersionPrerelease=DEV" -o bin/prometheus-es-adapter cmd/adapter/*.go

command-line-arguments

cmd/adapter/main.go:68:57: cannot use "go.uber.org/zap".Error(err) (type "go.uber.org/zap/zapcore".Field) as type "github.com/pwillie/prometheus-es-adapter/vendor/go.uber.org/zap/zapcore".Field in argument to log.Fatal cmd/adapter/main.go:80:40: cannot use client (type "gopkg.in/olivere/elastic.v6".Client) as type "github.com/pwillie/prometheus-es-adapter/vendor/gopkg.in/olivere/elastic.v6".Client in argument to elasticsearch.NewIndexService cmd/adapter/main.go:82:50: cannot use "go.uber.org/zap".Error(err) (type "go.uber.org/zap/zapcore".Field) as type "github.com/pwillie/prometheus-es-adapter/vendor/go.uber.org/zap/zapcore".Field in argument to log.Fatal cmd/adapter/main.go:89:41: cannot use client (type "gopkg.in/olivere/elastic.v6".Client) as type "github.com/pwillie/prometheus-es-adapter/vendor/gopkg.in/olivere/elastic.v6".Client in argument to elasticsearch.NewReadService cmd/adapter/main.go:99:48: cannot use client (type "gopkg.in/olivere/elastic.v6".Client) as type "github.com/pwillie/prometheus-es-adapter/vendor/gopkg.in/olivere/elastic.v6".Client in argument to elasticsearch.NewWriteService cmd/adapter/main.go:101:65: cannot use "go.uber.org/zap".Error(err) (type "go.uber.org/zap/zapcore".Field) as type "github.com/pwillie/prometheus-es-adapter/vendor/go.uber.org/zap/zapcore".Field in argument to log.Fatal cmd/adapter/main.go:106:57: cannot use client (type "gopkg.in/olivere/elastic.v6".Client) as type "github.com/pwillie/prometheus-es-adapter/vendor/gopkg.in/olivere/elastic.v6".Client in argument to "github.com/pwillie/prometheus-es-adapter/pkg/handlers".NewAdminRouter make: *** [build] Error 2

Thanks for your help on that issue.

pwillie commented 5 years ago

Hi Daniel,

I don't use RHEL and have been unable to reproduce your issue but looking at your details I would guess that your GOPATH is incorrect.

To build using Golang 1.10 using docker you can use something like:

dallanic commented 5 years ago

Hi Peter,

Thanks for those elements, I will look into fixing the GOPATH problem.