Bug 1997528

Summary: instance:etcd_object_counts:sum and cluster:usage:resources:sum use the etcd_object_counts metric which is deprecated
Product: OpenShift Container Platform Reporter: Simon Pasquier <spasquie>
Component: MonitoringAssignee: Simon Pasquier <spasquie>
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: high    
Version: 4.9CC: amuller, anpicker, aos-bugs, arajkuma, erooth
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-18 17:49:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Simon Pasquier 2021-08-25 12:51:46 UTC
Description of problem:
CMO ships 2 recording rules (instance:etcd_object_counts:sum and cluster:usage:resources:sum) which use the etcd_object_counts metric which is deprecated since Kube v1.21 [1].

[1] https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.21.md

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Check the definition of instance:etcd_object_counts:sum and cluster:usage:resources:sum

Actual results:
They use etcd_object_counts.

Expected results:
They don't use deprecated metrics.

Additional info:
etcd_object_counts is replaced by apiserver_storage_objects which has the same labels and semantics.

Comment 4 Junqi Zhao 2021-08-27 06:24:27 UTC
tested with 4.9.0-0.nightly-2021-08-26-164418, etcd_object_counts is replaced by apiserver_storage_objects
# oc -n openshift-monitoring get cm prometheus-k8s-rulefiles-0 -oyaml | grep -E "instance:etcd_object_counts:sum|cluster:usage:resources:sum" -C1
      - expr: sum by (instance) (apiserver_storage_objects)
        record: instance:etcd_object_counts:sum
      - expr: topk(500, max by(resource) (apiserver_storage_objects))
        record: cluster:usage:resources:sum

Comment 11 errata-xmlrpc 2021-10-18 17:49:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.