Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop register to prom registry #84135

Merged
merged 1 commit into from Nov 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -49,18 +49,12 @@ func Handler() http.Handler {
// Register registers a collectable metric but uses the global registry
func Register(c metrics.Registerable) error {
err := defaultRegistry.Register(c)
// sideload global prom registry as fallback
prometheus.Register(c)
return err
}

// MustRegister registers registerable metrics but uses the global registry.
func MustRegister(cs ...metrics.Registerable) {
defaultRegistry.MustRegister(cs...)
// sideload global prom registry as fallback
for _, c := range cs {
prometheus.Register(c)
}
}

// RawMustRegister registers prometheus collectors but uses the global registry, this
Expand All @@ -69,10 +63,6 @@ func MustRegister(cs ...metrics.Registerable) {
// Deprecated
func RawMustRegister(cs ...prometheus.Collector) {
defaultRegistry.RawMustRegister(cs...)
// sideload global prom registry as fallback
for _, c := range cs {
prometheus.Register(c)
}
}

// RawRegister registers a prometheus collector but uses the global registry, this
Expand All @@ -81,7 +71,5 @@ func RawMustRegister(cs ...prometheus.Collector) {
// Deprecated
func RawRegister(c prometheus.Collector) error {
err := defaultRegistry.RawRegister(c)
// sideload global prom registry as fallback
prometheus.Register(c)
return err
}