Git Product home page Git Product logo

Comments (6)

bastischubert avatar bastischubert commented on May 27, 2024 2

Removing the whole vendor dir did the job for me (Fedora 27 and Ubuntu 16.04 )

git clone https://github.com/digitalocean/ceph_exporter.git ceph_exporter
cd ceph_exporter
# use the luminous branch
git checkout luminous
go get -d .
rm -rf $GOPATH/src/github.com/digitalocean/ceph_exporter/vendor/*
# use current go version:
perl -pni -e "s#1.5.3#1.10.1#g" Makefile.COMMON 
make

HTH

from ceph_exporter.

cristicalin avatar cristicalin commented on May 27, 2024 1

What version of golang are you using?
For us it works with golang 1.8 (Ubuntu 16.04 go packages from https://launchpad.net/~gophers/+archive/ubuntu/archive).

Here's a snippet from our docker build script:

export GOHOME=/usr/lib/go-1.8
export PATH=${GOHOME}/bin:${PATH}
export GOPATH=/go
export APPLOC=${GOPATH}/src/github.com/digitalocean
pushd ${APPLOC}
git clone https://github.com/digitalocean/ceph_exporter.git ceph_exporter
pushd ceph_exporter
go get -d .
go build -o /bin/ceph_exporter

from ceph_exporter.

wwalker avatar wwalker commented on May 27, 2024

for me the following works
cd ceph_exporter
make

from ceph_exporter.

CrazyZfk avatar CrazyZfk commented on May 27, 2024

It's not work for me.

Here is what happened:

[root@ceph ceph_exporter]# make
GO15VENDOREXPERIMENT=1 GOROOT=/usr/lib/golang /usr/lib/golang/bin/go build  -o ceph_exporter
# _/root/ceph_exporter
./exporter.go:49: cannot use collectors.NewClusterUsageCollector(conn, cluster) (type *collectors.ClusterUsageCollector) as type "github.com/prometheus/client_golang/prometheus".Collector in array or slice literal:
	*collectors.ClusterUsageCollector does not implement "github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
		have Collect(chan<- "github.com/digitalocean/ceph_exporter/vendor/github.com/prometheus/client_golang/prometheus".Metric)
		want Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
./exporter.go:50: cannot use collectors.NewPoolUsageCollector(conn, cluster) (type *collectors.PoolUsageCollector) as type "github.com/prometheus/client_golang/prometheus".Collector in array or slice literal:
	*collectors.PoolUsageCollector does not implement "github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
		have Collect(chan<- "github.com/digitalocean/ceph_exporter/vendor/github.com/prometheus/client_golang/prometheus".Metric)
		want Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
./exporter.go:51: cannot use collectors.NewClusterHealthCollector(conn, cluster) (type *collectors.ClusterHealthCollector) as type "github.com/prometheus/client_golang/prometheus".Collector in array or slice literal:
	*collectors.ClusterHealthCollector does not implement "github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
		have Collect(chan<- "github.com/digitalocean/ceph_exporter/vendor/github.com/prometheus/client_golang/prometheus".Metric)
		want Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
./exporter.go:52: cannot use collectors.NewMonitorCollector(conn, cluster) (type *collectors.MonitorCollector) as type "github.com/prometheus/client_golang/prometheus".Collector in array or slice literal:
	*collectors.MonitorCollector does not implement "github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
		have Collect(chan<- "github.com/digitalocean/ceph_exporter/vendor/github.com/prometheus/client_golang/prometheus".Metric)
		want Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
./exporter.go:53: cannot use collectors.NewOSDCollector(conn, cluster) (type *collectors.OSDCollector) as type "github.com/prometheus/client_golang/prometheus".Collector in array or slice literal:
	*collectors.OSDCollector does not implement "github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
		have Collect(chan<- "github.com/digitalocean/ceph_exporter/vendor/github.com/prometheus/client_golang/prometheus".Metric)
		want Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
make: *** [ceph_exporter] Error 2

from ceph_exporter.

gtonello avatar gtonello commented on May 27, 2024

Hi guys,
I had the same issue here, trying to build ceph_exporter into CentOS 7.4, with golang 1.9.

Follow a snippet of what I did:

export GOPATH=$(pwd)
export PATH=$PATH:$GOPATH/bin
git clone https://github.com/digitalocean/ceph_exporter.git ceph_exporter
go get -d <each_package>
make

Errors output shows that you have prometheus in a different path that exporter.go is expecting. I only had to remove prometheus from src/github.com/digitalocean/ceph_exporter/vendor/github.com/prometheus/client_golang/prometheus and run make again.

from ceph_exporter.

sosodev avatar sosodev commented on May 27, 2024

Builds seem to be working fine with modern versions of Go :)

from ceph_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.