diff --git a/prometheus/histogram.go b/prometheus/histogram.go index 56a54aa..331783a 100644 --- a/prometheus/histogram.go +++ b/prometheus/histogram.go @@ -387,7 +387,7 @@ func (v *HistogramVec) With(labels Labels) Observer { // vectors behave identically in terms of collection. Only one must be // registered with a given registry (usually the uncurried version). The Reset // method deletes all metrics, even if called on a curried vector. -func (v *HistogramVec) CurryWith(labels Labels) (*HistogramVec, error) { +func (v *HistogramVec) CurryWith(labels Labels) (ObserverVec, error) { vec, err := v.curryWith(labels) if vec != nil { return &HistogramVec{vec}, err @@ -397,7 +397,7 @@ func (v *HistogramVec) CurryWith(labels Labels) (*HistogramVec, error) { // MustCurryWith works as CurryWith but panics where CurryWith would have // returned an error. -func (v *HistogramVec) MustCurryWith(labels Labels) *HistogramVec { +func (v *HistogramVec) MustCurryWith(labels Labels) ObserverVec { vec, err := v.CurryWith(labels) if err != nil { panic(err) diff --git a/prometheus/observer.go b/prometheus/observer.go index b0520e8..5806cd0 100644 --- a/prometheus/observer.go +++ b/prometheus/observer.go @@ -45,6 +45,8 @@ type ObserverVec interface { GetMetricWithLabelValues(lvs ...string) (Observer, error) With(Labels) Observer WithLabelValues(...string) Observer + CurryWith(Labels) (ObserverVec, error) + MustCurryWith(Labels) ObserverVec Collector } diff --git a/prometheus/summary.go b/prometheus/summary.go index cc0452a..f7dc85b 100644 --- a/prometheus/summary.go +++ b/prometheus/summary.go @@ -504,7 +504,7 @@ func (v *SummaryVec) With(labels Labels) Observer { // vectors behave identically in terms of collection. Only one must be // registered with a given registry (usually the uncurried version). The Reset // method deletes all metrics, even if called on a curried vector. -func (v *SummaryVec) CurryWith(labels Labels) (*SummaryVec, error) { +func (v *SummaryVec) CurryWith(labels Labels) (ObserverVec, error) { vec, err := v.curryWith(labels) if vec != nil { return &SummaryVec{vec}, err @@ -514,7 +514,7 @@ func (v *SummaryVec) CurryWith(labels Labels) (*SummaryVec, error) { // MustCurryWith works as CurryWith but panics where CurryWith would have // returned an error. -func (v *SummaryVec) MustCurryWith(labels Labels) *SummaryVec { +func (v *SummaryVec) MustCurryWith(labels Labels) ObserverVec { vec, err := v.CurryWith(labels) if err != nil { panic(err)