diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go index 61e26592b9b..21eb1828567 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go @@ -72,10 +72,9 @@ var ( ) objectCounts = compbasemetrics.NewGaugeVec( &compbasemetrics.GaugeOpts{ - Name: "apiserver_storage_objects", - Help: "Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1.", - StabilityLevel: compbasemetrics.STABLE, - DeprecatedVersion: "1.34.0", + Name: "apiserver_storage_objects", + Help: "[DEPRECATED, consider using apiserver_resource_objects instead] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1.", + StabilityLevel: compbasemetrics.STABLE, }, []string{"resource"}, ) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics_test.go b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics_test.go index efe7322305b..200739b1bd7 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics_test.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics_test.go @@ -250,7 +250,7 @@ apiserver_resource_objects{group="foo",resource="bar"} 10 # HELP apiserver_resource_size_estimate_bytes [ALPHA] Estimated size of stored objects in database. Estimate is based on sum of last observed sizes of serialized objects. In case of a fetching error, the value will be -1. # TYPE apiserver_resource_size_estimate_bytes gauge apiserver_resource_size_estimate_bytes{group="foo",resource="bar"} -1 -# HELP apiserver_storage_objects [STABLE] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. +# HELP apiserver_storage_objects [STABLE] [DEPRECATED, consider using apiserver_resource_objects instead] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. # TYPE apiserver_storage_objects gauge apiserver_storage_objects{resource="bar.foo"} 10 `, @@ -265,7 +265,7 @@ apiserver_resource_objects{group="foo",resource="bar"} 10 # HELP apiserver_resource_size_estimate_bytes [ALPHA] Estimated size of stored objects in database. Estimate is based on sum of last observed sizes of serialized objects. In case of a fetching error, the value will be -1. # TYPE apiserver_resource_size_estimate_bytes gauge apiserver_resource_size_estimate_bytes{group="foo",resource="bar"} 100 -# HELP apiserver_storage_objects [STABLE] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. +# HELP apiserver_storage_objects [STABLE] [DEPRECATED, consider using apiserver_resource_objects instead] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. # TYPE apiserver_storage_objects gauge apiserver_storage_objects{resource="bar.foo"} 10 `, @@ -280,7 +280,7 @@ apiserver_resource_objects{group="foo",resource="bar"} 0 # HELP apiserver_resource_size_estimate_bytes [ALPHA] Estimated size of stored objects in database. Estimate is based on sum of last observed sizes of serialized objects. In case of a fetching error, the value will be -1. # TYPE apiserver_resource_size_estimate_bytes gauge apiserver_resource_size_estimate_bytes{group="foo",resource="bar"} 0 -# HELP apiserver_storage_objects [STABLE] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. +# HELP apiserver_storage_objects [STABLE] [DEPRECATED, consider using apiserver_resource_objects instead] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. # TYPE apiserver_storage_objects gauge apiserver_storage_objects{resource="bar.foo"} 0 `, @@ -292,7 +292,7 @@ apiserver_storage_objects{resource="bar.foo"} 0 want: `# HELP apiserver_resource_objects [ALPHA] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. # TYPE apiserver_resource_objects gauge apiserver_resource_objects{group="foo",resource="bar"} -1 -# HELP apiserver_storage_objects [STABLE] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. +# HELP apiserver_storage_objects [STABLE] [DEPRECATED, consider using apiserver_resource_objects instead] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. # TYPE apiserver_storage_objects gauge apiserver_storage_objects{resource="bar.foo"} -1 # HELP apiserver_resource_size_estimate_bytes [ALPHA] Estimated size of stored objects in database. Estimate is based on sum of last observed sizes of serialized objects. In case of a fetching error, the value will be -1. @@ -325,7 +325,7 @@ func TestDeleteStoreStats(t *testing.T) { # TYPE apiserver_resource_size_estimate_bytes gauge apiserver_resource_size_estimate_bytes{group="foo1",resource="bar1"} -1 apiserver_resource_size_estimate_bytes{group="foo2",resource="bar2"} 200 -# HELP apiserver_storage_objects [STABLE] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. +# HELP apiserver_storage_objects [STABLE] [DEPRECATED, consider using apiserver_resource_objects instead] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. # TYPE apiserver_storage_objects gauge apiserver_storage_objects{resource="bar1.foo1"} 10 apiserver_storage_objects{resource="bar2.foo2"} 20 @@ -339,7 +339,7 @@ apiserver_storage_objects{resource="bar2.foo2"} 20 expectedMetrics = `# HELP apiserver_resource_size_estimate_bytes [ALPHA] Estimated size of stored objects in database. Estimate is based on sum of last observed sizes of serialized objects. In case of a fetching error, the value will be -1. # TYPE apiserver_resource_size_estimate_bytes gauge apiserver_resource_size_estimate_bytes{group="foo2",resource="bar2"} 200 -# HELP apiserver_storage_objects [STABLE] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. +# HELP apiserver_storage_objects [STABLE] [DEPRECATED, consider using apiserver_resource_objects instead] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. # TYPE apiserver_storage_objects gauge apiserver_storage_objects{resource="bar2.foo2"} 20 ` @@ -348,7 +348,7 @@ apiserver_storage_objects{resource="bar2.foo2"} 20 } DeleteStoreStats(schema.GroupResource{Group: "foo2", Resource: "bar2"}) - expectedMetrics = `# HELP apiserver_storage_objects [STABLE] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. + expectedMetrics = `# HELP apiserver_storage_objects [STABLE] [DEPRECATED, consider using apiserver_resource_objects instead] Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1. # TYPE apiserver_storage_objects gauge ` if err := testutil.GatherAndCompare(registry, strings.NewReader(expectedMetrics), "apiserver_storage_objects", "apiserver_resource_size_estimate_bytes"); err != nil { diff --git a/test/instrumentation/testdata/stable-metrics-list.yaml b/test/instrumentation/testdata/stable-metrics-list.yaml index 94f9ea5a701..4a62babc6ce 100644 --- a/test/instrumentation/testdata/stable-metrics-list.yaml +++ b/test/instrumentation/testdata/stable-metrics-list.yaml @@ -411,10 +411,10 @@ - 1e+08 - 1e+09 - name: apiserver_storage_objects - help: Number of stored objects at the time of last check split by kind. In case - of a fetching error, the value will be -1. + help: '[DEPRECATED, consider using apiserver_resource_objects instead] Number of + stored objects at the time of last check split by kind. In case of a fetching + error, the value will be -1.' type: Gauge - deprecatedVersion: 1.34.0 stabilityLevel: STABLE labels: - resource