Skip to content

Commit 26f61c2

Browse files
richabankerk8s-publishing-bot
authored andcommitted
Remove DeprecatedVersion for apiserver_storage_objects, adjust help text
Kubernetes-commit: cbd6fb867ba26f977df605fe6a84f8570ed7abdc
1 parent aced81d commit 26f61c2

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

pkg/storage/etcd3/metrics/metrics.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ var (
7272
)
7373
objectCounts = compbasemetrics.NewGaugeVec(
7474
&compbasemetrics.GaugeOpts{
75-
Name: "apiserver_storage_objects",
76-
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.",
77-
StabilityLevel: compbasemetrics.STABLE,
78-
DeprecatedVersion: "1.34.0",
75+
Name: "apiserver_storage_objects",
76+
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.",
77+
StabilityLevel: compbasemetrics.STABLE,
7978
},
8079
[]string{"resource"},
8180
)

pkg/storage/etcd3/metrics/metrics_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ apiserver_resource_objects{group="foo",resource="bar"} 10
250250
# 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.
251251
# TYPE apiserver_resource_size_estimate_bytes gauge
252252
apiserver_resource_size_estimate_bytes{group="foo",resource="bar"} -1
253-
# 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.
253+
# 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.
254254
# TYPE apiserver_storage_objects gauge
255255
apiserver_storage_objects{resource="bar.foo"} 10
256256
`,
@@ -265,7 +265,7 @@ apiserver_resource_objects{group="foo",resource="bar"} 10
265265
# 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.
266266
# TYPE apiserver_resource_size_estimate_bytes gauge
267267
apiserver_resource_size_estimate_bytes{group="foo",resource="bar"} 100
268-
# 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.
268+
# 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.
269269
# TYPE apiserver_storage_objects gauge
270270
apiserver_storage_objects{resource="bar.foo"} 10
271271
`,
@@ -280,7 +280,7 @@ apiserver_resource_objects{group="foo",resource="bar"} 0
280280
# 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.
281281
# TYPE apiserver_resource_size_estimate_bytes gauge
282282
apiserver_resource_size_estimate_bytes{group="foo",resource="bar"} 0
283-
# 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.
283+
# 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.
284284
# TYPE apiserver_storage_objects gauge
285285
apiserver_storage_objects{resource="bar.foo"} 0
286286
`,
@@ -292,7 +292,7 @@ apiserver_storage_objects{resource="bar.foo"} 0
292292
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.
293293
# TYPE apiserver_resource_objects gauge
294294
apiserver_resource_objects{group="foo",resource="bar"} -1
295-
# 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.
295+
# 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.
296296
# TYPE apiserver_storage_objects gauge
297297
apiserver_storage_objects{resource="bar.foo"} -1
298298
# 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) {
325325
# TYPE apiserver_resource_size_estimate_bytes gauge
326326
apiserver_resource_size_estimate_bytes{group="foo1",resource="bar1"} -1
327327
apiserver_resource_size_estimate_bytes{group="foo2",resource="bar2"} 200
328-
# 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.
328+
# 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.
329329
# TYPE apiserver_storage_objects gauge
330330
apiserver_storage_objects{resource="bar1.foo1"} 10
331331
apiserver_storage_objects{resource="bar2.foo2"} 20
@@ -339,7 +339,7 @@ apiserver_storage_objects{resource="bar2.foo2"} 20
339339
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.
340340
# TYPE apiserver_resource_size_estimate_bytes gauge
341341
apiserver_resource_size_estimate_bytes{group="foo2",resource="bar2"} 200
342-
# 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.
342+
# 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.
343343
# TYPE apiserver_storage_objects gauge
344344
apiserver_storage_objects{resource="bar2.foo2"} 20
345345
`
@@ -348,7 +348,7 @@ apiserver_storage_objects{resource="bar2.foo2"} 20
348348
}
349349

350350
DeleteStoreStats(schema.GroupResource{Group: "foo2", Resource: "bar2"})
351-
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.
351+
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.
352352
# TYPE apiserver_storage_objects gauge
353353
`
354354
if err := testutil.GatherAndCompare(registry, strings.NewReader(expectedMetrics), "apiserver_storage_objects", "apiserver_resource_size_estimate_bytes"); err != nil {

0 commit comments

Comments
 (0)