Bug 1903424

Summary: mapi_machine_phase_transition_seconds_sum doesn't work
Product: OpenShift Container Platform Reporter: sunzhaohua <zhsun>
Component: Cloud ComputeAssignee: Joel Speed <jspeed>
Cloud Compute sub component: Other Providers QA Contact: sunzhaohua <zhsun>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: mimccune
Version: 4.7   
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:37:21 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:

Description sunzhaohua 2020-12-02 03:44:30 UTC
Description of problem:
mapi_machine_phase_transition_seconds_sum doesn't work

Version-Release number of selected component (if applicable):
4.7.0-0.nightly-2020-11-30-172451

How reproducible:
always

Steps to Reproduce:
1.Query mapi_machine_phase_transition_seconds_sum from GUI
2.
3.

Actual results:
Get "No datapoints found"

Expected results:
Could get the metrics.

Additional info:

Comment 1 Joel Speed 2020-12-02 10:44:46 UTC
Already working on fixing this. We need to revendor the MAO dependency in repositories for the providers. This is blocked on revendoring the GCP provider into MAO first, this is in progress.

Comment 2 Michael McCune 2020-12-02 20:28:33 UTC
is it possible this is just a mismatch of the metric name?

i see `mapi_machine_phase_transition_seconds` in the code[0], without the `_sum` on the end.

[0] https://github.com/openshift/machine-api-operator/blob/master/pkg/metrics/metrics.go#L71

Comment 3 sunzhaohua 2020-12-03 01:55:38 UTC
(In reply to Michael McCune from comment #2)
> is it possible this is just a mismatch of the metric name?
> 
> i see `mapi_machine_phase_transition_seconds` in the code[0], without the
> `_sum` on the end.
> 
> [0]
> https://github.com/openshift/machine-api-operator/blob/master/pkg/metrics/
> metrics.go#L71

Comment from Joel Speed: This is a histogram metrics so you can't actually query for the name directly, under the hood it records the total number of observations and the sum of the observations, so you should be able to see `mapi_machine_phase_transition_seconds_sum` and `mapi_machine_phase_transition_seconds_count` as two metrics but not `mapi_machine_phase_transition_seconds`

Comment 4 Michael McCune 2020-12-03 14:41:51 UTC
> (In reply to Michael McCune from comment #2)
> Comment from Joel Speed: This is a histogram metrics so you can't actually
> query for the name directly, under the hood it records the total number of
> observations and the sum of the observations, so you should be able to see
> `mapi_machine_phase_transition_seconds_sum` and
> `mapi_machine_phase_transition_seconds_count` as two metrics but not
> `mapi_machine_phase_transition_seconds`

ack, i did not realize that lol. thanks Joel!

Comment 5 Michael McCune 2020-12-04 21:15:39 UTC
PRs to fix this are currently under review

Comment 7 sunzhaohua 2020-12-17 08:03:09 UTC
Verified on gcp
clusterversion: 4.7.0-0.nightly-2020-12-14-165231

$  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 | grep "mapi_machine_phase_transition_seconds"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73228    0 73228    0     0  1787k      0 --:--:-- --:--:-- --:--:-- 1833k
    "mapi_machine_phase_transition_seconds_bucket",
    "mapi_machine_phase_transition_seconds_count",
    "mapi_machine_phase_transition_seconds_sum",

Comment 8 sunzhaohua 2020-12-18 07:39:40 UTC
Verified on osp aws azure.
clusterversion: 4.7.0-0.nightly-2020-12-17-201522

Comment 11 errata-xmlrpc 2021-02-24 15:37:21 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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-2020:5633