MCPcopy
hub / github.com/prometheus/client_golang / CurryWith

Method CurryWith

prometheus/histogram.go:1291–1297  ·  view source on GitHub ↗

CurryWith returns a vector curried with the provided labels, i.e. the returned vector has those labels pre-set for all labeled operations performed on it. The cardinality of the curried vector is reduced accordingly. The order of the remaining labels stays the same (just with the curried labels take

(labels Labels)

Source from the content-addressed store, hash-verified

1289// registered with a given registry (usually the uncurried version). The Reset
1290// method deletes all metrics, even if called on a curried vector.
1291func (v *HistogramVec) CurryWith(labels Labels) (ObserverVec, error) {
1292 vec, err := v.MetricVec.CurryWith(labels)
1293 if vec != nil {
1294 return &HistogramVec{vec}, err
1295 }
1296 return nil, err
1297}
1298
1299// MustCurryWith works as CurryWith but panics where CurryWith would have
1300// returned an error.

Callers 1

MustCurryWithMethod · 0.95

Calls 1

CurryWithMethod · 0.65

Tested by

no test coverage detected