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

Method DeleteLabelValues

prometheus/vec.go:74–83  ·  view source on GitHub ↗

DeleteLabelValues removes the metric where the variable labels are the same as those passed in as labels (same order as the VariableLabels in Desc). It returns true if a metric was deleted. It is not an error if the number of label values is not the same as the number of VariableLabels in Desc. How

(lvs ...string)

Source from the content-addressed store, hash-verified

72// with a performance overhead (for creating and processing the Labels map).
73// See also the CounterVec example.
74func (m *MetricVec) DeleteLabelValues(lvs ...string) bool {
75 lvs = constrainLabelValues(m.desc, lvs, m.curry)
76
77 h, err := m.hashLabelValues(lvs)
78 if err != nil {
79 return false
80 }
81
82 return m.deleteByHashWithLabelValues(h, lvs, m.curry)
83}
84
85// Delete deletes the metric where the variable labels are the same as those
86// passed in as labels. It returns true if a metric was deleted.

Calls 3

hashLabelValuesMethod · 0.95
constrainLabelValuesFunction · 0.85