Bug 1745654 - Namespace memory calculations are incorrect on namespace overview page
Summary: Namespace memory calculations are incorrect on namespace overview page
Keywords:
Status: CLOSED DUPLICATE of bug 1733825
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.2.0
Assignee: Matthias Loibl
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-26 15:06 UTC by Clayton Coleman
Modified: 2023-09-14 05:42 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-27 13:12:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Clayton Coleman 2019-08-26 15:06:43 UTC
https://www.dropbox.com/s/9okvf89gc1s42bz/Screenshot%202019-08-26%2011.02.18.png?dl=0

The namespace summary is wrong.  It should be showing the sum of pod cgroup metrics in the namespace

    sum(metric{namespace="A",container_name="",pod_name!=""})

Is correct.

Setting high because the number is wildly wrong.

Comment 1 Samuel Padgett 2019-08-26 17:27:20 UTC
We're using `namespace:container_memory_usage_bytes:sum{namespace='${ns.metadata.name}'}` as the query.  Frederic, is there an issue with this recording rule?

What's in the screenshot is clearly wrong, but I haven't been able to reproduce.

Comment 2 Samuel Padgett 2019-08-26 19:31:00 UTC
We use the same query in other contexts, so these likely have the same issue:

~/work/console master
❯ rg container_memory_usage_bytes
frontend/public/components/build.tsx
125:          query={`pod_name:container_memory_usage_bytes:sum{pod_name='${podName}',container_name='',namespace='${namespace}'}`}

frontend/public/components/namespace.jsx
264:      query={`namespace:container_memory_usage_bytes:sum{namespace='${ns.metadata.name}'}`}
273:    query={`sort_desc(topk(10, sum by (pod_name)(container_memory_usage_bytes{container_name!="POD",container_name!="",pod_name!="", namespace="${ns.metadata.name}"})))`}

frontend/public/components/pod.tsx
184:        query={`pod_name:container_memory_usage_bytes:sum{pod_name='${pod.metadata.name}',namespace='${pod.metadata.namespace}'}`}

frontend/public/components/overview/index.tsx
475:      memory: `pod_name:container_memory_usage_bytes:sum{namespace="${namespace}"}`,

frontend/public/components/dashboards-page/overview-dashboard/queries.ts
28:  [OverviewQuery.PODS_BY_MEMORY]: 'sort_desc(pod_name:container_memory_usage_bytes:sum)',

Comment 3 Samuel Padgett 2019-08-27 13:02:50 UTC
We can change the queries in console, but I'd expect we'd want to fix `namespace:container_memory_usage_bytes:sum` and `namespace:container_cpu_usage:sum` if they're wrong. Assigning to the monitoring team to investigate. If console is simply using the wrong queries, let us know.

Comment 5 Sergiusz Urbaniak 2019-08-27 13:12:04 UTC

*** This bug has been marked as a duplicate of bug 1733825 ***

Comment 6 Red Hat Bugzilla 2023-09-14 05:42:19 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


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