dcu / mongodb_exporter

MongoDB exporter for prometheus.io
MIT License
356 stars 216 forks source link

index_counters.go:35: too many errors #40

Closed ZOXEXIVO closed 7 years ago

ZOXEXIVO commented 8 years ago

Can't build exporter with Go 1.73

wolfencom commented 8 years ago

I'm having this same problem.

OK: 348 MiB in 44 packages

github.com/dcu/mongodb_exporter/collector

collector/asserts.go:26: assertsTotal.WithLabelValues("regular").Set undefined (type prometheus.Counter has no field or method Set) collector/asserts.go:27: assertsTotal.WithLabelValues("warning").Set undefined (type prometheus.Counter has no field or method Set) collector/asserts.go:28: assertsTotal.WithLabelValues("msg").Set undefined (type prometheus.Counter has no field or method Set) collector/asserts.go:29: assertsTotal.WithLabelValues("user").Set undefined (type prometheus.Counter has no field or method Set) collector/asserts.go:30: assertsTotal.WithLabelValues("rollovers").Set undefined (type prometheus.Counter has no field or method Set) collector/background_flushing.go:53: backgroundFlushingflushesTotal.Set undefined (type prometheus.Counter has no field or method Set) collector/background_flushing.go:54: backgroundFlushingtotalMilliseconds.Set undefined (type prometheus.Counter has no field or method Set) collector/connections.go:36: connectionsMetricsCreatedTotal.Set undefined (type prometheus.Counter has no field or method Set) collector/global_lock.go:79: globalLockTotal.Set undefined (type prometheus.Counter has no field or method Set) collector/index_counters.go:35: indexCountersTotal.WithLabelValues("accesses").Set undefined (type prometheus.Counter has no field or method Set) collector/index_counters.go:35: too many errors The command '/bin/sh -c apk add --update -t build-deps go git mercurial libc-dev gcc libgcc && cd $APPPATH && go get -d && go build -o /bin/mongodb_exporter && apk del --purge build-deps && rm -rf $GOPATH' returned a non-zero code: 2

I've tried on coreos 1122.3.0, and Ubuntu 16.10. It happens both when checking out the code and doing a simple make build, and when trying to do a docker build. This isn't specific to go 1.7 either, I tried with both 1.6 and 1.7, plus when trying to build the docker image it pulls 1.6.3.

deepthawtz commented 8 years ago

this has nothing to do w/ Go version... It looks like the Prometheus Golang client changed up and the version was not pinned so these broke...

Updating to work w/ the latest version...

arthur-c commented 7 years ago

Hi, https://github.com/dcu/mongodb_exporter/pull/44 is not solving the problem for me.

go version
go version go1.6.3 linux/amd64
go get -u github.com/dcu/mongodb_exporter                                          
# github.com/dcu/mongodb_exporter/collector
workspace/go/src/github.com/dcu/mongodb_exporter/collector/asserts.go:26: assertsTotal.WithLabelValues("regular").Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/asserts.go:27: assertsTotal.WithLabelValues("warning").Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/asserts.go:28: assertsTotal.WithLabelValues("msg").Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/asserts.go:29: assertsTotal.WithLabelValues("user").Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/asserts.go:30: assertsTotal.WithLabelValues("rollovers").Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/background_flushing.go:53: backgroundFlushingflushesTotal.Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/background_flushing.go:54: backgroundFlushingtotalMilliseconds.Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/connections.go:36: connectionsMetricsCreatedTotal.Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/global_lock.go:79: globalLockTotal.Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/index_counters.go:35: indexCountersTotal.WithLabelValues("accesses").Set undefined (type prometheus.Counter has no field or method Set)
workspace/go/src/github.com/dcu/mongodb_exporter/collector/index_counters.go:35: too many errors
deepthawtz commented 7 years ago

44 was never merged, that's why the compile issues still exists...

we'll have to pin the version of prometheus client in order for what's on master to work

bamarni commented 7 years ago

@deepthawtz : I've submitted a PR to vendor prometheus client to v0.8.0, using gopkg.in would have been the best option but unfortunately that didn't work, I think because of the underscore in the prometheus client repo.