mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
add delete to counterVec wrapper, since we require it in the kubelet
This commit is contained in:
parent
8f0d626228
commit
3150b2b437
@ -149,3 +149,17 @@ func (v *CounterVec) With(labels prometheus.Labels) CounterMetric {
|
|||||||
}
|
}
|
||||||
return v.CounterVec.With(labels)
|
return v.CounterVec.With(labels)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 match an actual metric, so the method will always return false in
|
||||||
|
// that case.
|
||||||
|
func (v *CounterVec) Delete(labels prometheus.Labels) bool {
|
||||||
|
if !v.IsCreated() {
|
||||||
|
return false // since we haven't created the metric, we haven't deleted a metric with the passed in values
|
||||||
|
}
|
||||||
|
return v.CounterVec.Delete(labels)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user