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.
Addressed in https://github.com/kubevirt/hostpath-provisioner-operator/pull/345 and https://github.com/kubevirt/hostpath-provisioner/pull/234.
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= + [[ '' != '' ]]
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