Bug 1806787

Summary: "openshift_console_operator_build_info" is not exposed for console-operator
Product: OpenShift Container Platform Reporter: Junqi Zhao <juzhao>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: aos-bugs, jhadvig, jokerman
Target Milestone: ---Flags: jhadvig: needinfo?
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Wrong registering method for the build_info metric Consequence: "openshift_console_operator_build_info" is not exposed for console-operator Fix: Use the proper registering method for the build_info metric Result: "openshift_console_operator_build_info" exposed for console-operator
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-13 17:20:54 UTC 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:
Bug Depends On:    
Bug Blocks: 1807858    

Description Junqi Zhao 2020-02-25 02:55:00 UTC
Description of problem:
This bug is from https://bugzilla.redhat.com/show_bug.cgi?id=1798315#c11
`openshift_console_operator_build_info` metrics should be expoosed for the console-operator, but it is not

# oc get pod -n openshift-console-operator
NAME                                READY   STATUS    RESTARTS   AGE
console-operator-75cb66d64d-sqdd4   1/1     Running   5          19h

# oc get ep -n openshift-console-operator
NAME      ENDPOINTS          AGE
metrics   10.129.0.13:8443   19h

# token=`oc sa get-token prometheus-k8s -n openshift-monitoring`
# oc -n openshift-console-operator exec console-operator-75cb66d64d-sqdd4 -- curl -k -H "Authorization: Bearer $token" 'https://10.130.0.15:8443/metrics'  | grep "openshift_console_operator_build_info"
no result

NOTE: Check all the metrics collected by Prometheus by followings, there is not `openshift_console_operator_build_info` metrics either
# token=`oc sa get-token prometheus-k8s -n openshift-monitoring`
# oc -n openshift-monitoring exec -c prometheus prometheus-k8s-0 -- curl -k -H "Authorization: Bearer $token" 'https://prometheus-k8s.openshift-monitoring.svc:9091/api/v1/label/__name__/values'  | jq




Version-Release number of selected component (if applicable):
4.4.0-0.nightly-2020-02-24-020331

How reproducible:
Always

Steps to Reproduce:
1. See the description
2.
3.

Actual results:
"openshift_console_operator_build_info" is not exposed for console-operator

Expected results:
"openshift_console_operator_build_info" exposed for console-operator

Additional info:

Comment 2 Junqi Zhao 2020-02-25 03:02:43 UTC
(In reply to Junqi Zhao from comment #0)
Correction:
> # oc -n openshift-console-operator exec console-operator-75cb66d64d-sqdd4 --
> curl -k -H "Authorization: Bearer $token" 'https://10.130.0.15:8443/metrics'
> | grep "openshift_console_operator_build_info"
> no result

it should be
# oc -n openshift-console-operator exec console-operator-75cb66d64d-sqdd4 -- curl -k -H "Authorization: Bearer $token" 'https://10.129.0.13:8443'  | grep "openshift_console_operator_build_info"
no result

Comment 3 Junqi Zhao 2020-02-25 03:04:41 UTC
(In reply to Junqi Zhao from comment #2)
> (In reply to Junqi Zhao from comment #0)
> Correction:
> > # oc -n openshift-console-operator exec console-operator-75cb66d64d-sqdd4 --
> > curl -k -H "Authorization: Bearer $token" 'https://10.130.0.15:8443/metrics'
> > | grep "openshift_console_operator_build_info"
> > no result
> 
> it should be
> # oc -n openshift-console-operator exec console-operator-75cb66d64d-sqdd4 --
> curl -k -H "Authorization: Bearer $token" 'https://10.129.0.13:8443'  | grep
> "openshift_console_operator_build_info"
> no result

sorry, should be

# oc -n openshift-console-operator exec console-operator-75cb66d64d-sqdd4 -- curl -k -H "Authorization: Bearer $token" 'https://10.129.0.13:8443/metrics'  | grep "openshift_console_operator_build_info"
no result

Comment 6 shahan 2020-03-09 04:15:53 UTC
$ oc -n openshift-console-operator exec console-operator-8c69d7cbc-wltx8  -- curl -k -H "Authorization: Bearer $token" 'https://10.130.0.23:8443/metrics'  | grep "openshift_console_operator_build_info"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0# HELP openshift_console_operator_build_info [ALPHA] A metric with a constant '1' value labeled by major, minor, git commit & git version from which OpenShift Console Operator was built.
# TYPE openshift_console_operator_build_info gauge
openshift_console_operator_build_info{gitCommit="88d29bf",gitVersion="4.5.0-202003052146-88d29bf",major="4",minor="5"} 1
100 47012    0 47012    0     0   328k      0 --:--:-- --:--:-- --:--:--  330k


4.5.0-0.nightly-2020-03-06-190457

Comment 8 errata-xmlrpc 2020-07-13 17:20:54 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, 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/RHBA-2020:2409