File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
staging/src/k8s.io/component-base/metrics Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -148,3 +148,17 @@ func (v *GaugeVec) With(labels prometheus.Labels) GaugeMetric {
148
148
}
149
149
return v .GaugeVec .With (labels )
150
150
}
151
+
152
+ // Delete deletes the metric where the variable labels are the same as those
153
+ // passed in as labels. It returns true if a metric was deleted.
154
+ //
155
+ // It is not an error if the number and names of the Labels are inconsistent
156
+ // with those of the VariableLabels in Desc. However, such inconsistent Labels
157
+ // can never match an actual metric, so the method will always return false in
158
+ // that case.
159
+ func (v * GaugeVec ) Delete (labels prometheus.Labels ) bool {
160
+ if ! v .IsCreated () {
161
+ return false // since we haven't created the metric, we haven't deleted a metric with the passed in values
162
+ }
163
+ return v .GaugeVec .Delete (labels )
164
+ }
Original file line number Diff line number Diff line change @@ -143,3 +143,17 @@ func (v *HistogramVec) With(labels prometheus.Labels) ObserverMetric {
143
143
}
144
144
return v .HistogramVec .With (labels )
145
145
}
146
+
147
+ // Delete deletes the metric where the variable labels are the same as those
148
+ // passed in as labels. It returns true if a metric was deleted.
149
+ //
150
+ // It is not an error if the number and names of the Labels are inconsistent
151
+ // with those of the VariableLabels in Desc. However, such inconsistent Labels
152
+ // can never match an actual metric, so the method will always return false in
153
+ // that case.
154
+ func (v * HistogramVec ) Delete (labels prometheus.Labels ) bool {
155
+ if ! v .IsCreated () {
156
+ return false // since we haven't created the metric, we haven't deleted a metric with the passed in values
157
+ }
158
+ return v .HistogramVec .Delete (labels )
159
+ }
Original file line number Diff line number Diff line change @@ -150,3 +150,17 @@ func (v *SummaryVec) With(labels prometheus.Labels) ObserverMetric {
150
150
}
151
151
return v .SummaryVec .With (labels )
152
152
}
153
+
154
+ // Delete deletes the metric where the variable labels are the same as those
155
+ // passed in as labels. It returns true if a metric was deleted.
156
+ //
157
+ // It is not an error if the number and names of the Labels are inconsistent
158
+ // with those of the VariableLabels in Desc. However, such inconsistent Labels
159
+ // can never match an actual metric, so the method will always return false in
160
+ // that case.
161
+ func (v * SummaryVec ) Delete (labels prometheus.Labels ) bool {
162
+ if ! v .IsCreated () {
163
+ return false // since we haven't created the metric, we haven't deleted a metric with the passed in values
164
+ }
165
+ return v .SummaryVec .Delete (labels )
166
+ }
You can’t perform that action at this time.
0 commit comments