Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Consider removing statsd_exporter dependency #22

Open
robfig opened this issue Jul 15, 2020 · 0 comments
Open

Consider removing statsd_exporter dependency #22

robfig opened this issue Jul 15, 2020 · 0 comments

Comments

@robfig
Copy link

robfig commented Jul 15, 2020

statsd_exporter contains a vendored copy of the prometheus client which results in a panic on startup for me:

panic: proto: duplicate enum registered: io.prometheus.client.MetricType

goroutine 1 [running]:
github.com/golang/protobuf/proto.RegisterEnum(...)
   external/com_github_golang_protobuf/proto/properties.go:458
github.com/prometheus/statsd_exporter/vendor/github.com/prometheus/client_model/go.init.0()
   external/com_github_prometheus_statsd_exporter/vendor/github.com/prometheus/client_model/go/metrics.pb.go:663 +0x332

The reason is that the prometheus client includes protobufs, which register their enums in a global registry on init, and so the vendored prometheus client conflicts with our separately imported one.

I can work around this, but I wanted to suggest that copy/paste might be preferred for the one function from statsd_exporter that you use (or pulling it out into a prometheus-common module), instead of importing an unrelated module with many dependencies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant