mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rebase: update kubernetes to v1.25.0
update kubernetes to latest v1.25.0 release. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
f47839d73d
commit
e3bf375035
17
vendor/k8s.io/component-base/metrics/counter.go
generated
vendored
17
vendor/k8s.io/component-base/metrics/counter.go
generated
vendored
@ -18,6 +18,7 @@ package metrics
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/blang/semver/v4"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
@ -106,9 +107,14 @@ type CounterVec struct {
|
||||
originalLabels []string
|
||||
}
|
||||
|
||||
// NewCounterVec returns an object which satisfies the kubeCollector and CounterVecMetric interfaces.
|
||||
var _ kubeCollector = &CounterVec{}
|
||||
|
||||
// TODO: make this true: var _ CounterVecMetric = &CounterVec{}
|
||||
|
||||
// NewCounterVec returns an object which satisfies the kubeCollector and (almost) CounterVecMetric interfaces.
|
||||
// However, the object returned will not measure anything unless the collector is first
|
||||
// registered, since the metric is lazily instantiated.
|
||||
// registered, since the metric is lazily instantiated, and only members extracted after
|
||||
// registration will actually measure anything.
|
||||
func NewCounterVec(opts *CounterOpts, labels []string) *CounterVec {
|
||||
opts.StabilityLevel.setDefaults()
|
||||
|
||||
@ -149,13 +155,16 @@ func (v *CounterVec) initializeDeprecatedMetric() {
|
||||
v.initializeMetric()
|
||||
}
|
||||
|
||||
// Default Prometheus behavior actually results in the creation of a new metric
|
||||
// if a metric with the unique label values is not found in the underlying stored metricMap.
|
||||
// Default Prometheus Vec behavior is that member extraction results in creation of a new element
|
||||
// if one with the unique label values is not found in the underlying stored metricMap.
|
||||
// This means that if this function is called but the underlying metric is not registered
|
||||
// (which means it will never be exposed externally nor consumed), the metric will exist in memory
|
||||
// for perpetuity (i.e. throughout application lifecycle).
|
||||
//
|
||||
// For reference: https://github.com/prometheus/client_golang/blob/v0.9.2/prometheus/counter.go#L179-L197
|
||||
//
|
||||
// In contrast, the Vec behavior in this package is that member extraction before registration
|
||||
// returns a permanent noop object.
|
||||
|
||||
// WithLabelValues returns the Counter for the given slice of label
|
||||
// values (same order as the VariableLabels in Desc). If that combination of
|
||||
|
Reference in New Issue
Block a user