Merge pull request #410 from mattdurham/use_instance_registry

Use the instance registry instead of the prometheus.registry
This commit is contained in:
Matthias Rampke 2021-11-26 11:20:40 +01:00 committed by GitHub
commit 6a5a089597
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,7 +259,7 @@ func (r *Registry) GetHistogram(metricName string, labels prometheus.Labels, hel
Buckets: buckets,
}, labelNames)
if err := prometheus.Register(uncheckedCollector{histogramVec}); err != nil {
if err := r.Registerer.Register(uncheckedCollector{histogramVec}); err != nil {
return nil, err
}
} else {
@ -328,7 +328,7 @@ func (r *Registry) GetSummary(metricName string, labels prometheus.Labels, help
BufCap: summaryOptions.BufCap,
}, labelNames)
if err := prometheus.Register(uncheckedCollector{summaryVec}); err != nil {
if err := r.Registerer.Register(uncheckedCollector{summaryVec}); err != nil {
return nil, err
}
} else {