Prometheus: remote_storage_adapter compilation errors with Go 1.9.2

Created on 15 Dec 2017  路  4Comments  路  Source: prometheus/prometheus

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

componenremote storage

Most helpful comment

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.

All 4 comments

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.

cool

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

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.

Was this page helpful?
0 / 5 - 0 ratings