Bug 2224828 - [HPP] Metric names fail in metrics name linter
Summary: [HPP] Metric names fail in metrics name linter
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Metrics
Version: 4.13.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.14.0
Assignee: Assaf Admi
QA Contact: Ahmad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-23 10:30 UTC by Assaf Admi
Modified: 2023-11-08 14:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 14:06:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt hostpath-provisioner-operator pull 345 0 None Merged Change `kubevirt_hpp_operator_up_total` name 2023-08-08 12:44:19 UTC
Github kubevirt hostpath-provisioner pull 234 0 None open Change `kubevirt_hpp_operator_up_total` name 2023-08-08 12:44:19 UTC
Red Hat Issue Tracker CNV-31241 0 None None None 2023-07-23 10:31:39 UTC
Red Hat Product Errata RHSA-2023:6817 0 None None None 2023-11-08 14:06:16 UTC

Description Assaf Admi 2023-07-23 10:30:33 UTC
Description of problem:
We applied a metrics names linter in kubevirt/hostpath-provisioner-operator based on promlint. kubevirt_hpp_operator_up_total has failed.

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


How reproducible:
100%

Steps to Reproduce:
1. run `make lint-metrics` in kubevirt/hostpath-provisioner-operator.

Actual results:
kubevirt_hpp_operator_up_total is not aligned with the naming conventions. 

Expected results:
All metrics to aligned with the naming conventions.

Comment 2 Ahmad 2023-08-23 14:39:49 UTC
QA: Verified on cnv 4.14

make lint-metrics passed with no fails + kubevirt_hpp_operator_up_total was changed to > kubevirt_hpp_operator_up
---------------------------------

[cloud-user@ocp-psi-executor hostpath-provisioner-operator]$ make lint-metrics
./hack/prom_metric_linter.sh --operator-name="kubevirt" --sub-operator-name="hpp"
+ linter_image_tag=v0.0.1
+++ dirname ./hack/prom_metric_linter.sh
++ readlink -e ./hack/../
+ PROJECT_ROOT=/home/cloud-user/ahmad/hostpath-provisioner-operator
+ export METRICS_COLLECTOR_PATH=/home/cloud-user/ahmad/hostpath-provisioner-operator/tools/prom-metrics-collector
+ METRICS_COLLECTOR_PATH=/home/cloud-user/ahmad/hostpath-provisioner-operator/tools/prom-metrics-collector
+ [[ ! -d /home/cloud-user/ahmad/hostpath-provisioner-operator/tools/prom-metrics-collector ]]
+ [[ 2 -gt 0 ]]
+ case "$1" in
+ operator_name=kubevirt
+ shift
+ [[ 1 -gt 0 ]]
+ case "$1" in
+ sub_operator_name=hpp
+ shift
+ [[ 0 -gt 0 ]]
+ go build -o _out/prom-metrics-collector /home/cloud-user/ahmad/hostpath-provisioner-operator/tools/prom-metrics-collector/...
++ _out/prom-metrics-collector
+ json_output='[{"name":"kubevirt_hpp_operator_up","help":"The number of running hostpath-provisioner-operator pods","type":1}]'
++ podman run -i quay.io/kubevirt/prom-metrics-linter:v0.0.1 '--metric-families=[{"name":"kubevirt_hpp_operator_up","help":"The number of running hostpath-provisioner-operator pods","type":1}]' --operator-name=kubevirt --sub-operator-name=hpp




[cloud-user@ocp-psi-executor hostpath-provisioner-operator]$ oc exec -n openshift-monitoring prometheus-k8s-0 -c prometheus -- curl -s http://127.0.0.1:9090/api/v1/query?query=kubevirt_hpp_operator_up | jq .
{
  "status": "success",
  "data": {
    "resultType": "vector",
    "result": [
      {
        "metric": {
          "__name__": "kubevirt_hpp_operator_up"
        },
        "value": [
          1692801467.971,
          "1"
        ]
      }
    ]
  }

+ errors=
+ [[ '' != '' ]]

Comment 4 errata-xmlrpc 2023-11-08 14:06:02 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 (Important: OpenShift Virtualization 4.14.0 Images security and bug fix 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.

https://access.redhat.com/errata/RHSA-2023:6817


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