Bug 1996785 - Unused rules in CMO
Summary: Unused rules in CMO
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.9
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.9.0
Assignee: Haoyu Sun
QA Contact: hongyan li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-23 16:37 UTC by Haoyu Sun
Modified: 2021-10-18 17:48 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:47:55 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-monitoring-operator pull 1316 0 None None None 2021-08-24 09:08:55 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:48:09 UTC

Description Haoyu Sun 2021-08-23 16:37:00 UTC
Description of problem:

The recording rules that are not unused in alerts, telemetry metrics, console, or dashboard definitions are wasting resources in Openshift Cluster. We need them removed.

The following rules are not used:
- build_error_rate
- cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
- code:registry_api_request_count:rate:sum
- instance:node_cpu:ratio
- kube_pod_status_ready:etcd:sum
- kube_pod_status_ready:image_registry:sum
- namespace:container_spec_cpu_shares:sum
- node:node_num_cpu:sum
- pod:container_spec_cpu_shares:sum


Version-Release number of selected component (if applicable):


How reproducible:
N/A

Steps to Reproduce:
N/A

Actual results:
The rules above are present in CMO.

Expected results:
The rules above are removed from CMO.

Additional info:

Comment 8 hongyan li 2021-09-06 04:17:04 UTC
$ oc -n openshift-monitoring get cm prometheus-k8s-rulefiles-0 -oyaml|grep -E '.yaml|build_error_rate|cluster_quantile:apiserver_request_duration_seconds:histogram_quantile|code:registry_api_request_count:rate:sum|instance:node_cpu:ratio|kube_pod_status_ready:etcd:sum|kube_pod_status_ready:image_registry:sum|namespace:container_spec_cpu_shares:sum|node:node_num_cpu:sum|pod:container_spec_cpu_shares:sum'

  openshift-kube-apiserver-kube-apiserver-slos.yaml: |
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile


$ oc -n openshift-monitoring get cm telemetry-config -oyaml|grep -E 'build_error_rate|cluster_quantile:apiserver_request_duration_seconds:histogram_quantile|code:registry_api_request_count:rate:sum|instance:node_cpu:ratio|kube_pod_status_ready:etcd:sum|kube_pod_status_ready:image_registry:sum|namespace:container_spec_cpu_shares:sum|node:node_num_cpu:sum|pod:container_spec_cpu_shares:sum'
no result

$ for i in $(oc -n openshift-monitoring get cm | grep grafana | awk '{print $1}'); do echo $i; oc -n openshift-monitoring get cm $i -oyaml | grep  -E "build_error_rate|cluster_quantile:apiserver_request_duration_seconds:histogram_quantile|code:registry_api_request_count:rate:sum|instance:node_cpu:ratio|kube_pod_status_ready:etcd:sum|kube_pod_status_ready:image_registry:sum|namespace:container_spec_cpu_shares:sum|node:node_num_cpu:sum|pod:container_spec_cpu_shares:sum"; echo -e "\n"; done
grafana-dashboard-cluster-total
no result

$ oc -n openshift-monitoring get cm prometheus-k8s-rulefiles-0 -oyaml|grep -E -C20 cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
---
      - expr: |
          histogram_quantile(0.99, sum by (le, resource) (rate(apiserver_request_duration_seconds_bucket{job="apiserver",verb=~"LIST|GET"}[5m]))) > 0
        labels:
          quantile: "0.99"
          verb: read
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
      - expr: |
          histogram_quantile(0.99, sum by (le, resource) (rate(apiserver_request_duration_seconds_bucket{job="apiserver",verb=~"POST|PUT|PATCH|DELETE"}[5m]))) > 0
        labels:
          quantile: "0.99"
          verb: write
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
      - expr: |
          histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{job="apiserver",subresource!="log",verb!~"LIST|WATCH|WATCHLIST|DELETECOLLECTION|PROXY|CONNECT"}[5m])) without(instance, pod))
        labels:
          quantile: "0.99"
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
      - expr: |
          histogram_quantile(0.9, sum(rate(apiserver_request_duration_seconds_bucket{job="apiserver",subresource!="log",verb!~"LIST|WATCH|WATCHLIST|DELETECOLLECTION|PROXY|CONNECT"}[5m])) without(instance, pod))
        labels:
          quantile: "0.9"
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
      - expr: |
          histogram_quantile(0.5, sum(rate(apiserver_request_duration_seconds_bucket{job="apiserver",subresource!="log",verb!~"LIST|WATCH|WATCHLIST|DELETECOLLECTION|PROXY|CONNECT"}[5m])) without(instance, pod))
        labels:
          quantile: "0.5"
        record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile

$ oc -n openshift-kube-apiserver get prometheusrules kube-apiserver-slos -oyaml | grep "cluster_quantile:apiserver_request_duration_seconds:histogram_quantile"
      record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
      record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
      record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
      record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile
      record: cluster_quantile:apiserver_request_duration_seconds:histogram_quantile

The above recording rules under namespace openshift-kube-apiserver that are not unused in alerts, telemetry metrics, console, or dashboard definitions are wasting resources in Openshift Cluster, they should be removed, but they are not shipped by monitoring, will file a new bug.

Comment 9 hongyan li 2021-09-06 04:41:30 UTC
Test with payload 4.9.0-0.nightly-2021-09-05-192114

Comment 14 errata-xmlrpc 2021-10-18 17:47:55 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.9.0 bug fix and security 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-2021:3759


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