Merge pull request #99785 from erain/issue/98270

metrics: etcd_object_counts->apiserver_storage_object_counts(stable)
This commit is contained in:
Kubernetes Prow Robot
2021-03-09 11:05:50 -08:00
committed by GitHub
2 changed files with 20 additions and 3 deletions

View File

@@ -43,11 +43,20 @@ var (
},
[]string{"operation", "type"},
)
etcdObjectCounts = compbasemetrics.NewGaugeVec(
&compbasemetrics.GaugeOpts{
Name: "etcd_object_counts",
DeprecatedVersion: "1.21.0",
Help: "Number of stored objects at the time of last check split by kind. This metric is replaced by apiserver_storage_object_counts.",
StabilityLevel: compbasemetrics.ALPHA,
},
[]string{"resource"},
)
objectCounts = compbasemetrics.NewGaugeVec(
&compbasemetrics.GaugeOpts{
Name: "etcd_object_counts",
Name: "apiserver_storage_object_counts",
Help: "Number of stored objects at the time of last check split by kind.",
StabilityLevel: compbasemetrics.ALPHA,
StabilityLevel: compbasemetrics.STABLE,
},
[]string{"resource"},
)
@@ -86,15 +95,17 @@ func Register() {
registerMetrics.Do(func() {
legacyregistry.MustRegister(etcdRequestLatency)
legacyregistry.MustRegister(objectCounts)
legacyregistry.MustRegister(etcdObjectCounts)
legacyregistry.MustRegister(dbTotalSize)
legacyregistry.MustRegister(etcdBookmarkCounts)
legacyregistry.MustRegister(etcdLeaseObjectCounts)
})
}
// UpdateObjectCount sets the etcd_object_counts metric.
// UpdateObjectCount sets the apiserver_storage_object_counts and etcd_object_counts (deprecated) metric.
func UpdateObjectCount(resourcePrefix string, count int64) {
objectCounts.WithLabelValues(resourcePrefix).Set(float64(count))
etcdObjectCounts.WithLabelValues(resourcePrefix).Set(float64(count))
}
// RecordEtcdRequestLatency sets the etcd_request_duration_seconds metrics.

View File

@@ -65,3 +65,9 @@
- subresource
- verb
- version
- name: apiserver_storage_object_counts
help: Number of stored objects at the time of last check split by kind.
type: Gauge
stabilityLevel: STABLE
labels:
- resource