Delete deletes the metric where the variable labels are the same as those passed in as labels. It returns true if a metric was deleted. It is not an error if the number and names of the Labels are inconsistent with those of the VariableLabels in Desc. However, such inconsistent Labels can never mat
(labels Labels)
| 93 | // This method is used for the same purpose as DeleteLabelValues(...string). See |
| 94 | // there for pros and cons of the two methods. |
| 95 | func (m *MetricVec) Delete(labels Labels) bool { |
| 96 | labels, closer := constrainLabels(m.desc, labels) |
| 97 | defer closer() |
| 98 | |
| 99 | h, err := m.hashLabels(labels) |
| 100 | if err != nil { |
| 101 | return false |
| 102 | } |
| 103 | |
| 104 | return m.deleteByHashWithLabels(h, labels, m.curry) |
| 105 | } |
| 106 | |
| 107 | // DeletePartialMatch deletes all metrics where the variable labels contain all of those |
| 108 | // passed in as labels. The order of the labels does not matter. |