mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
feat: Add function to reset label allow list for apiserver endpoints metrics
This commit is contained in:
parent
d34c181465
commit
d3795eaf76
@ -416,6 +416,33 @@ func Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
// ResetLabelAllowLists resets the label allow lists for all metrics.
|
||||
// NOTE: This is only used for testing.
|
||||
func ResetLabelAllowLists() {
|
||||
for _, metric := range metrics {
|
||||
if counterVec, ok := metric.(*compbasemetrics.CounterVec); ok {
|
||||
counterVec.ResetLabelAllowLists()
|
||||
continue
|
||||
}
|
||||
if gaugeVec, ok := metric.(*compbasemetrics.GaugeVec); ok {
|
||||
gaugeVec.ResetLabelAllowLists()
|
||||
continue
|
||||
}
|
||||
if histogramVec, ok := metric.(*compbasemetrics.HistogramVec); ok {
|
||||
histogramVec.ResetLabelAllowLists()
|
||||
continue
|
||||
}
|
||||
if summaryVec, ok := metric.(*compbasemetrics.SummaryVec); ok {
|
||||
summaryVec.ResetLabelAllowLists()
|
||||
continue
|
||||
}
|
||||
if timingHistogramVec, ok := metric.(*compbasemetrics.TimingHistogramVec); ok {
|
||||
timingHistogramVec.ResetLabelAllowLists()
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateInflightRequestMetrics reports concurrency metrics classified by
|
||||
// mutating vs Readonly.
|
||||
func UpdateInflightRequestMetrics(phase string, nonmutating, mutating int) {
|
||||
|
Loading…
Reference in New Issue
Block a user