Bug 2179660

Summary: [HCO] Metric names fail in metrics name linter
Product: Container Native Virtualization (CNV) Reporter: Aviv Litman <alitman>
Component: MetricsAssignee: Shirly Radco <sradco>
Status: VERIFIED --- QA Contact: Debarati Basu-Nag <dbasunag>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.13.0CC: alitman, apinnick, aspauldi, dbasunag, kmajcher, sradco, stirabos
Target Milestone: ---   
Target Release: 4.14.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hco-bundle-registry-container-v4.14.0.rhel9-1560 Doc Type: Release Note
Doc Text:
Metrics names are updated: - `kubevirt_hco_out_of_band_modifications_count` to `kubevirt_hco_out_of_band_modifications_total`. - `kubevirt_hco_unsafe_modification_count` to `kubevirt_hco_number_of_unsafe_modifications`.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Aviv Litman 2023-03-19 16:04:27 UTC
Description of problem:
We added a metric name linter, that will check if the metric name meets the best practices requirements see: https://github.com/kubevirt/hyperconverged-cluster-operator/pull/2291.
The linter failed with the following errors:

- kubevirt_hco_out_of_band_modifications_count: counter metrics should have 'total' suffix.
- kubevirt_hco_out_of_band_modifications_count: non-histogram and non-summary metrics should not have 'count' or 'sum' 
- kubevirt_hco_unsafe_modification_count: non-histogram and non-summary metrics should not have 'count' or 'sum' suffix.

We should updates the names:
- `kubevirt_hco_out_of_band_modifications_count` to `kubevirt_hco_out_of_band_modifications_total`.

- `kubevirt_hco_unsafe_modification_count` to `kubevirt_hco_number_of_unsafe_modifications`. 

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

How reproducible:
100%

Steps to Reproduce:
1. open a pr
2. see the sanity check  
3. see the metric name linter errors

Actual results:
metric names are not valid.

Expected results:
metrics names are valid.

Comment 1 Krzysztof Majcher 2023-03-21 13:40:46 UTC
Please rememeber to doublecheck if documentation will autogenerate.
In first pass of the fix please consider deprecating 'old' names and introduce new ones to finally get rid of the 'old' names in the following release.
Please also remember to check if 'old' names are not used to show any of the metrics somewhere in the UI.

Comment 2 Audrey Spaulding 2023-05-08 19:06:09 UTC
@sradco, Is this a Known Issue or a Changed Feature for the 4.13 release notes? Thanks.

Comment 3 Shirly Radco 2023-05-24 07:45:49 UTC
@aspauldi The inconsistencies were found when we run the new metrics name linter.
We consider this as a bug. There should be a deprecation notice for the metrics listed in this bug.

Comment 6 Debarati Basu-Nag 2023-08-15 18:47:15 UTC
As of CNV-v4.14.0.rhel9-1576, I see  `kubevirt_hco_unsafe_modification_count` has been renamed to `kubevirt_hco_unsafe_modifications ` and 
`kubevirt_hco_out_of_band_modifications_count` has been renamed to `kubevirt_hco_out_of_band_modifications_total`. However, the doc text field values are not correct (see the first rename).