Bug 1851920

Summary: CPUThrottlingHigh and other alerts lack namespace restrictions
Product: OpenShift Container Platform Reporter: Lili Cosic <lcosic>
Component: MonitoringAssignee: Sergiusz Urbaniak <surbania>
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: low    
Version: 4.4CC: alegrand, anpicker, erooth, hongyli, juzhao, kakkoyun, lcosic, maszulik, mloibl, pkrupa, surbania, wking
Target Milestone: ---   
Target Release: 4.4.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1851873 Environment:
Last Closed: 2020-07-14 01:43:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1851873    
Bug Blocks:    

Comment 3 Junqi Zhao 2020-07-06 02:41:38 UTC
Tested with 4.4.0-0.nightly-2020-07-04-120349, CPUThrottlingHigh alert have been added namespace restrictions
# oc -n openshift-monitoring exec -c prometheus prometheus-k8s-0 -- cat cat /etc/prometheus/rules/prometheus-k8s-rulefiles-0/openshift-monitoring-prometheus-k8s-rules.yaml | grep CPUThrottlingHigh -A 12
cat: cat: No such file or directory
  - alert: CPUThrottlingHigh
    annotations:
      message: '{{ $value | humanizePercentage }} throttling of CPU in namespace {{
        $labels.namespace }} for container {{ $labels.container }} in pod {{ $labels.pod
        }}.'
    expr: |
      sum(increase(container_cpu_cfs_throttled_periods_total{container!="", namespace=~"(openshift-.*|kube-.*|default|logging)"}[5m])) by (container, pod, namespace)
        /
      sum(increase(container_cpu_cfs_periods_total{namespace=~"(openshift-.*|kube-.*|default|logging)"}[5m])) by (container, pod, namespace)
        > ( 25 / 100 )
    for: 15m
    labels:
      severity: warning

Comment 5 errata-xmlrpc 2020-07-14 01:43:54 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, 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/RHBA-2020:2871