Gbp-Pq: Name go-metrics_prometheus-fix_Observer.patch
}
type timer struct {
- m prometheus.Histogram
+ m prometheus.Observer
}
func (t *timer) Update(duration time.Duration) {
}
func (t *timer) Describe(c chan<- *prometheus.Desc) {
- t.m.Describe(c)
+ c <- t.m.(prometheus.Metric).Desc()
}
func (t *timer) Collect(c chan<- prometheus.Metric) {
- t.m.Collect(c)
+ // Are there any observers that don't implement Collector? It is really
+ // unclear what the point of the upstream change was, but we'll let this
+ // panic if we get an observer that doesn't implement collector. In this
+ // case, we should almost always see metricVec objects, so this should
+ // never panic.
+ t.m.(prometheus.Collector).Collect(c)
}