messagebird / pushprom

Pushprom is a proxy to the Prometheus Go client.
https://www.messagebird.com
BSD 2-Clause "Simplified" License
80 stars 13 forks source link

prometheus.RegisterOrGet is deprecated and breaks make when client is updated to last version #9

Closed marcelcorso closed 7 years ago

marcelcorso commented 7 years ago

Just tried to update the golang client of prometheus to 0.8.0 and got some errors. Most importantly undefined: prometheus.RegisterOrGet.

pushprom$ rm -rf  vendor/src/github.com/prometheus/client_golang/
pushprom$ make dependencies
* go getting all dependencies into vendor/
# pushprom
src/pushprom/delta.go:63: undefined: prometheus.RegisterOrGet
src/pushprom/delta.go:75: undefined: prometheus.RegisterOrGet
src/pushprom/delta.go:86: metric.Set undefined (type prometheus.Counter has no field or method Set)
src/pushprom/delta.go:107: undefined: prometheus.RegisterOrGet
src/pushprom/delta.go:119: undefined: prometheus.RegisterOrGet
src/pushprom/delta.go:155: undefined: prometheus.RegisterOrGet
src/pushprom/delta.go:167: undefined: prometheus.RegisterOrGet
src/pushprom/delta.go:194: undefined: prometheus.RegisterOrGet
src/pushprom/delta.go:206: undefined: prometheus.RegisterOrGet
Makefile:51: recipe for target 'dependencies' failed
make: *** [dependencies] Error 2
marcelcorso commented 7 years ago

I think it got removed here https://github.com/prometheus/client_golang/issues/46

marcelcorso commented 7 years ago

This test gives a hint on how to have the same behaviour with new code https://github.com/prometheus/client_golang/blob/3fb8ace93bc4ccddea55af62320c2fd109252880/prometheus/registry_test.go#L507