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

remote_storage_adapter compilation errors with Go 1.9.2 #3591

Closed
tzz opened this Issue Dec 15, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@tzz
Copy link

tzz commented Dec 15, 2017

What did you do?

Clone prometheus.git
Install Go 1.9.2

cd prometheus/documentation/examples/remote_storage/remote_storage_adapter
rm -rf $GOPATH
go get -d -v
go build

What did you expect to see?

Binary produced.

What did you see instead? Under which circumstances?

% go get -d -v
github.com/go-kit/kit (download)
created GOPATH=/home/tzlatanov/gocode; see 'go help gopath'
github.com/go-logfmt/logfmt (download)
github.com/go-stack/stack (download)
github.com/gogo/protobuf (download)
github.com/golang/snappy (download)
github.com/influxdata/influxdb (download)
github.com/prometheus/client_golang (download)
github.com/beorn7/perks (download)
github.com/golang/protobuf (download)
github.com/prometheus/client_model (download)
github.com/prometheus/common (download)
github.com/matttproud/golang_protobuf_extensions (download)
github.com/prometheus/procfs (download)
github.com/pkg/errors (download)
github.com/prometheus/prometheus (download)

% go build
# _/home/tzlatanov/source/prometheus/documentation/examples/remote_storage/remote_storage_
adapter
./main.go:168:19: cannot use c (type *graphite.Client) as type writer in append:
        *graphite.Client does not implement writer (wrong type for Write method)
                have Write("github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model".Samples) error
                want Write("github.com/prometheus/common/model".Samples) error
./main.go:176:19: cannot use c (type *opentsdb.Client) as type writer in append:
        *opentsdb.Client does not implement writer (wrong type for Write method)
                have Write("github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model".Samples) error
                want Write("github.com/prometheus/common/model".Samples) error
./main.go:191:12: cannot use conf (type "github.com/influxdata/influxdb/client/v2".HTTPConfig) as type "github.com/prometheus/prometheus/vendor/github.com/influxdata/influxdb/client/v2".HTTPConfig in argument to influxdb.NewClient
./main.go:196:26: cannot use c (type *influxdb.Client) as type "github.com/prometheus/client_golang/prometheus".Collector in argument to "github.com/prometheus/client_golang/prometheus".MustRegister:
        *influxdb.Client does not implement "github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
                have Collect(chan<- "github.com/prometheus/prometheus/vendor/github.com/prometheus/client_golang/prometheus".Metric)
                want Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
./main.go:197:19: cannot use c (type *influxdb.Client) as type writer in append:
        *influxdb.Client does not implement writer (wrong type for Write method)
                have Write("github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model".Samples) error
                want Write("github.com/prometheus/common/model".Samples) error

Environment

CentOS 7.2
Go 1.9.2

% go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tzlatanov/gocode"
GORACE=""
GOROOT="/usr/local/go-1.9.2"
GOTOOLDIR="/usr/local/go-1.9.2/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build997020660=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
  • System information:

    Linux

@tzz

This comment has been minimized.

Copy link
Author

tzz commented Dec 15, 2017

Resolved with go build github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter

Leaving issue open in case this should be in the docs. Thanks.

@jacktrane

This comment has been minimized.

Copy link

jacktrane commented Dec 26, 2017

cool

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented May 16, 2018

You need a working Go environment to compile Go, in particular the correct directory layout.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.