Bug 1856351 - Build page should show metrics for when the build ran, not the last 30 minutes
Summary: Build page should show metrics for when the build ran, not the last 30 minutes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.7.0
Assignee: Jon Jackson
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-13 12:57 UTC by Paul Weil
Modified: 2021-02-24 15:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: All resource utilization charts show the last hour by default. Consequence: Builds that ran more than an hour ago would show empty charts. Fix: Adjust the utilization charts timespan to account for the start and end time of a build. Result: Utilization charts on build details pages now show data for the time that the build ran.
Clone Of:
Environment:
Last Closed: 2021-02-24 15:13:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Build details charts when build ran one hour ago (124.43 KB, image/png)
2020-11-03 09:17 UTC, Yadan Pei
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 6879 0 None closed Bug 1856351: Fix build details page charts 2021-01-11 14:42:49 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:15:16 UTC

Description Paul Weil 2020-07-13 12:57:35 UTC
In some cases, the area charts on a k8s resource details page will always be empty. For instance, a build that finished more than an hour ago. Currently, our queries only cover the past hour, and since a resource in a terminal state will never generate any new Prometheus data, the charts on that resource's page will always be empty an hour after it terminates.

See https://issues.redhat.com/browse/CONSOLE-1752 for screenshot

Comment 1 Jon Jackson 2020-07-31 19:47:10 UTC
Will address next sprint.

Comment 2 Jon Jackson 2020-08-21 19:32:55 UTC
I haven't looked into a fix for this yet, but I know one issue we will have is that we only display the time on the x-axis of our utilization area charts. So if a build was not run 'today' or spans across multiple dates, the times displayed on the chart might be misleading. Since these charts are pretty compact, adding a date to the x-axis might be tricky, so we might need some design input on this. Maybe use a relative date string below the x-axis tick marks if the date !== today? So "a day ago", "a week ago", etc.

Comment 3 Jon Jackson 2020-09-11 21:03:35 UTC
Started work on this, but clamping the time introduces a few edge cases that make this a bit more complicated than it seems. Will continue work in upcoming sprint.

Comment 4 Jon Jackson 2020-10-02 13:35:58 UTC
Haven't circled back around to this yet as other 4.6 blockers were taking priority. I should be able to look at this next sprint.

Comment 5 Jon Jackson 2020-10-23 15:09:53 UTC
PR pending

Comment 7 Yadan Pei 2020-11-03 09:17:08 UTC
Created attachment 1726169 [details]
Build details charts when build ran one hour ago

Comment 8 Yadan Pei 2020-11-04 05:45:14 UTC
CPU Usage charts still show 'No datapoints found.' assigning back for confirmation

Comment 9 Yadan Pei 2020-11-04 05:45:58 UTC
let me know if the issue in comment 8 needs to be tracked in separate bug

Comment 10 Jon Jackson 2020-11-04 19:36:42 UTC
(In reply to Yadan Pei from comment #8)
> CPU Usage charts still show 'No datapoints found.' assigning back for
> confirmation

I think this should probably be tracked as a separate bug. I'd have to look further into why we aren't getting any data for CPU usage in some cases, but I don't think it's is related to the original bug. Our prometheus query time span is correct, as can be seen by the data on the other charts. The same start time and time span values are used for all charts on this page, so we are definitely querying CPU usage for the same timespan as the other utilization charts. I can think of 3 possibilities off the top of my head:

1. There is a problem with the CPU usage query
2. There is an edge case we aren't considering
3. Prometheus is legitimately returning no data for CPU usage in some cases.

My guess is the third case. Some of the builds I tested only ran for a few seconds, and probably were not CPU intensive, so I'm thinking that CPU usage was so miniscule that Prometheus doesn't return any data.

Comment 11 Yadan Pei 2020-11-10 06:54:06 UTC
When build runs one hour ago, the build charts are still visible on build details. And we show hour:minutes:seconds when build duration is short.

The original issue is fixed, will open separate bug for comment 8

Verified on 4.7.0-0.nightly-2020-11-09-235738

Comment 14 errata-xmlrpc 2021-02-24 15:13:57 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.