Open dallanic opened 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:
docker run --rm -ti -v $PWD:/go/src/github.com/pwillie/prometheus-es-adapter -w /go/src/github.com/pwillie/prometheus-es-adapter golang:1.10-stretch make build
This will mount the current directory into the docker container within the GOPATH. The built binary will be available at ./bin/
Hi Peter,
Thanks for those elements, I will look into fixing the GOPATH problem.
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.