Bug 1946860 - Memory utilization display error for dashboard Kubenetes/Computer Resource/Cluster
Summary: Memory utilization display error for dashboard Kubenetes/Computer Resource/Cl...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.8
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.8.0
Assignee: Pawel Krupa
QA Contact: hongyan li
URL:
Whiteboard:
: 1957420 (view as bug list)
Depends On:
Blocks: ocp-48-z-tracker
TreeView+ depends on / blocked
 
Reported: 2021-04-07 04:02 UTC by hongyan li
Modified: 2021-08-17 14:15 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-17 14:15:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
DB screenshot (86.45 KB, image/png)
2021-04-07 04:02 UTC, hongyan li
no flags Details
query screenshot (95.06 KB, image/png)
2021-04-07 04:04 UTC, hongyan li
no flags Details
show memory utilisation correctly (195.13 KB, image/png)
2021-05-07 10:02 UTC, Junqi Zhao
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github kubernetes-monitoring kubernetes-mixin pull 586 0 None open dashboards/resources: fix typo 2021-04-08 08:39:07 UTC

Description hongyan li 2021-04-07 04:02:54 UTC
Created attachment 1769748 [details]
DB screenshot

Description of problem:
Memory utilization display error for dashboard Kubenetes/Computer Resource/Cluster

Version-Release number of selected component (if applicable):
4.8.0-0.nightly-2021-04-06-162113

How reproducible:
always

Steps to Reproduce:
1.Go to Monitoring-Dashboards
2. Select Kubenetes/Computer Resource/Cluster from drop&down box
3.

Actual results:
Memory utilization display error for dashboard Kubenetes/Computer
1:121: parse error: unterminated quoted string"

Expected results:
Display data or '-'

Additional info:

Query is wrong
1 - sum(:node_memory_MemAvailable_bytes:sum{cluster=""}) / sum(kube_node_status_allocatable{resource="memory",cluster="""})

Comment 1 hongyan li 2021-04-07 04:04:28 UTC
Created attachment 1769749 [details]
query screenshot

Comment 2 Junqi Zhao 2021-04-07 04:14:28 UTC
the query parameter should be
1 - sum(:node_memory_MemAvailable_bytes:sum{cluster=""}) / sum(kube_node_status_allocatable{resource="memory",cluster=""})

checked form configmap,
"expr": "1 - sum(:node_memory_MemAvailable_bytes:sum{cluster=\"$cluster\"}) / sum(kube_node_status_allocatable{resource=\"memory\",cluster=\"$cluster\"\"})"
should be
"expr": "1 - sum(:node_memory_MemAvailable_bytes:sum{cluster=\"$cluster\"}) / sum(kube_node_status_allocatable{resource=\"memory\",cluster=\"$cluster\"})"
# oc -n openshift-monitoring get cm grafana-dashboard-k8s-resources-cluster -oyaml
...

                        "targets": [
                            {
                                "expr": "1 - sum(:node_memory_MemAvailable_bytes:sum{cluster=\"$cluster\"}) / sum(kube_node_status_allocatable{resource=\"memory\",cluster=\"$cluster\"\"})",
                                "format": "time_series",
                                "instant": true,
                                "intervalFactor": 2,
                                "refId": "A"
                            }
                        ],
                        "thresholds": "70,80",
                        "timeFrom": null,
                        "timeShift": null,
                        "title": "Memory Utilisation",
                        "tooltip": {
                            "shared": false,
                            "sort": 0,
                            "value_type": "individual"
                        },
...

Comment 4 Andrew Pickering 2021-04-07 09:44:59 UTC
This was already fixed in kubernetes-mixin by https://github.com/kubernetes-monitoring/kubernetes-mixin/pull/573

The fix appears to have already been pulled into the latest OpenShift master, so I'm setting this to MODIFIED.

Comment 5 Andrew Pickering 2021-04-07 09:50:26 UTC
Sorry, actually it looks like the kubernetes-mixin fix has not yet been pulled into OpenShift, so returning this to ASSIGNED.

Comment 6 Junqi Zhao 2021-05-07 09:56:02 UTC
*** Bug 1957420 has been marked as a duplicate of this bug. ***

Comment 7 Junqi Zhao 2021-05-07 10:01:10 UTC
issue is fixed with 4.8.0-0.nightly-2021-05-06-162549, see the attached picture
query expression is now:
1 - sum(:node_memory_MemAvailable_bytes:sum{cluster=""}) / sum(node_memory_MemTotal_bytes{cluster=""})

Comment 8 Junqi Zhao 2021-05-07 10:02:03 UTC
Created attachment 1780656 [details]
show memory utilisation correctly

Comment 9 Scott Dodson 2021-08-17 14:15:29 UTC
This was fixed prior to 4.8 GA.


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