Bug 1903424 - mapi_machine_phase_transition_seconds_sum doesn't work
Summary: mapi_machine_phase_transition_seconds_sum doesn't work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.7
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.7.0
Assignee: Joel Speed
QA Contact: sunzhaohua
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-02 03:44 UTC by sunzhaohua
Modified: 2021-02-24 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:37:21 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-api-provider-aws pull 378 0 None closed Bug 1903424: Ensure MAO dependency is up to date to include newest metrics 2021-01-29 06:01:05 UTC
Github openshift cluster-api-provider-azure pull 187 0 None closed Bug 1903424: Ensure MAO dependency is up to date to include newest metrics 2021-01-29 06:01:04 UTC
Github openshift cluster-api-provider-baremetal pull 129 0 None closed Bug 1903424: Ensure MAO dependency is up to date to include newest metrics 2021-01-29 06:01:05 UTC
Github openshift cluster-api-provider-gcp pull 139 0 None closed Bug 1903424: Ensure MAO dependency is up to date to include newest metrics 2021-01-29 06:01:04 UTC
Github openshift cluster-api-provider-openstack pull 141 0 None closed Bug 1903424: Ensure MAO dependency is up to date to include newest metrics 2021-01-29 06:01:05 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:37:55 UTC

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


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