Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-28671

[2196251] [Kubevirt] Metrics names failed promlint linter

XMLWordPrintable

    • CNV I/U Operators Sprint 236, CNV I/U Operators Sprint 237, CNV I/U Operators Sprint 238, CNV I/U Operators Sprint 239, CNV I/U Operators Sprint 240, CNV I/U Operators Sprint 241, CNV I/U Operators Sprint 242, CNV I/U Operators Sprint 243
    • Moderate
    • No

      Description of problem:
      We created a metric name linter in kubevirt based on promlint: https://github.com/kubevirt/kubevirt/pull/9709.
      This metrics names failed:

      $ make lint-metrics
      hack/dockerized "./hack/prom-metric-linter/metric_name_linter.sh"
      go version go1.19.2 linux/amd64

      go version go1.19.2 linux/amd64
      kubevirt_migrate_vmi_pending_count: non-histogram and non-summary metrics should not have "_count" suffix
      kubevirt_migrate_vmi_running_count: non-histogram and non-summary metrics should not have "_count" suffix
      kubevirt_migrate_vmi_scheduling_count: non-histogram and non-summary metrics should not have "_count" suffix
      kubevirt_vmi_cpu_affinity: counter metrics should have "_total" or "_timestamp_seconds" suffix
      kubevirt_vmi_filesystem_capacity_bytes_total: non-counter metrics should not have "_total" suffix
      kubevirt_vmi_memory_domain_bytes_total: non-counter metrics should not have "_total" suffix
      kubevirt_vmi_memory_pgmajfault: counter metrics should have "_total" or "_timestamp_seconds" suffix
      kubevirt_vmi_memory_pgminfault: counter metrics should have "_total" or "_timestamp_seconds" suffix
      kubevirt_vmi_memory_swap_in_traffic_bytes_total: non-counter metrics should not have "_total" suffix
      kubevirt_vmi_memory_swap_out_traffic_bytes_total: non-counter metrics should not have "_total" suffix
      kubevirt_vmi_outdated_count: non-histogram and non-summary metrics should not have "_count" suffix
      kubevirt_vmi_storage_flush_times_ms_total: metric names should not contain abbreviated units
      kubevirt_vmi_storage_read_times_ms_total: metric names should not contain abbreviated units
      kubevirt_vmi_storage_write_times_ms_total: metric names should not contain abbreviated units
      kubevirt_vmi_vcpu_seconds: counter metrics should have "_total" or "_timestamp_seconds" suffix
      kubevirt_vmi_vcpu_wait_seconds: counter metrics should have "_total" or "_timestamp_seconds" suffix
      kubevirt_vmsnapshot_disks_restored_from_source_total: non-counter metrics should not have "_total" suffix
      make: *** [Makefile:213: lint-metrics] Error 1

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

      How reproducible:
      100%

      Steps to Reproduce:
      1.cd kubevirt
      2.make lint-metrics

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

      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.

              sradco Shirly Radco
              alitman@redhat.com Aviv Litman
              Ahmad Hafi Ahmad Hafi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: