Bug 2218468 - [CDI] Metrics names failed promlint linter
Summary: [CDI] Metrics names failed promlint linter
Keywords:
Status: POST
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Metrics
Version: 4.13.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
: 4.14.0
Assignee: Aviv Litman
QA Contact: Ahmad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-29 09:14 UTC by Aviv Litman
Modified: 2023-08-17 15:10 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer issues 2515 0 None open clone_progress metric doesn't meet the metrics naming conventions 2023-08-08 12:46:04 UTC
Github kubevirt containerized-data-importer pull 2816 0 None open Update metric names to fit metrics naming conventions 2023-08-01 08:32:14 UTC
Red Hat Issue Tracker CNV-30389 0 None None None 2023-06-29 09:18:39 UTC

Description Aviv Litman 2023-06-29 09:14:45 UTC
Description of problem:
We created a metric name linter in kubevirt/containerized-data-importer based on promlint: https://github.com/kubevirt/containerized-data-importer/pull/2774.

This metrics names failed:
clone_progress: counter metrics should have "_total" or "_timestamp_seconds" suffix
clone_progress: name need to start with 'kubevirt_'
kubevirt_cdi_incomplete_storageprofiles_total: non-counter metrics should not have "_total" suffix
kubevirt_cdi_operator_up_total: non-counter metrics should not have "_total" suffix

In order to pass the linter the names can be:
`clone_progress` to `kubevirt_cdi_clone_progress_percentage_total`
`kubevirt_cdi_incomplete_storageprofiles_total` to `kubevirt_cdi_incomplete_storageprofiles`
`kubevirt_cdi_operator_up_total` to `kubevirt_cdi_operator_up`


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

How reproducible:
100%

Steps to Reproduce:
1. cd containerized-data-importer
2. checkout the pr https://github.com/kubevirt/containerized-data-importer/pull/2774 
3. remove the ignored metrics from excludedMetrics list in  
tools/prom-metrics-collector/metrics_collector.go (in order to see the erros)
4.make lint-metrics or make test-lint


Actual results:
some metric names are not aligned with promlint linter.

Expected results:
Metrics named will be aligned with promlint linter and Prometheus best practices.

Additional info:
as for now the list of metrics are ignored in the linter.

Comment 1 Assaf Admi 2023-07-13 07:10:08 UTC
In addition, in https://github.com/kubevirt/hostpath-provisioner-operator, kubevirt_hpp_operator_up_total metric is failing the metrics linter.

Comment 2 Aviv Litman 2023-08-01 08:34:58 UTC
(In reply to Assaf Admi from comment #1)
> In addition, in https://github.com/kubevirt/hostpath-provisioner-operator,
> kubevirt_hpp_operator_up_total metric is failing the metrics linter.

HPP will be handled in a separate bug: https://bugzilla.redhat.com/show_bug.cgi?id=2224828

Comment 3 Aviv Litman 2023-08-08 11:48:45 UTC
clone_ will be fixed in: https://github.com/kubevirt/containerized-data-importer/issues/2515

Comment 4 Aviv Litman 2023-08-08 11:49:22 UTC
(In reply to Aviv Litman from comment #3)
> clone_ will be fixed in:
> https://github.com/kubevirt/containerized-data-importer/issues/2515

*clone_progress


Note You need to log in before you can comment on or make changes to this bug.