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

Method CurryWith

prometheus/counter.go:314–320  ·  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

312// registered with a given registry (usually the uncurried version). The Reset
313// method deletes all metrics, even if called on a curried vector.
314func (v *CounterVec) CurryWith(labels Labels) (*CounterVec, error) {
315 vec, err := v.MetricVec.CurryWith(labels)
316 if vec != nil {
317 return &CounterVec{vec}, err
318 }
319 return nil, err
320}
321
322// MustCurryWith works as CurryWith but panics where CurryWith would have
323// returned an error.

Callers 1

MustCurryWithMethod · 0.95

Calls 1

CurryWithMethod · 0.65

Tested by

no test coverage detected