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

Method DeletePartialMatch

prometheus/vec.go:113–118  ·  view source on GitHub ↗

DeletePartialMatch deletes all metrics where the variable labels contain all of those passed in as labels. The order of the labels does not matter. It returns the number of metrics deleted. Note that curried labels will never be matched if deleting from the curried vector. To match curried labels w

(labels Labels)

Source from the content-addressed store, hash-verified

111// Note that curried labels will never be matched if deleting from the curried vector.
112// To match curried labels with DeletePartialMatch, it must be called on the base vector.
113func (m *MetricVec) DeletePartialMatch(labels Labels) int {
114 labels, closer := constrainLabels(m.desc, labels)
115 defer closer()
116
117 return m.deleteByLabels(labels, m.curry)
118}
119
120// Without explicit forwarding of Describe, Collect, Reset, those methods won't
121// show up in GoDoc.

Callers 1

testDeletePartialMatchFunction · 0.80

Calls 2

constrainLabelsFunction · 0.85
deleteByLabelsMethod · 0.80

Tested by 1

testDeletePartialMatchFunction · 0.64