Skip to content

Commit

Permalink
Add cgroup RSS queries
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Collins <[email protected]>
  • Loading branch information
afcollins committed Nov 13, 2024
1 parent ef7986d commit bbffbc4
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cmd/config/metrics-aggregated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,37 @@
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "worker",role != "infra" } ) by ( id )
metricName: cgroupMemoryRSS-Workers
instant: true
captureStart: true

- query: sum ( container_cpu_usage_seconds_total { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "master" } ) by ( id )
metricName: cgroupCPUSeconds-Masters
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "master" } ) by ( id )
metricName: cgroupMemoryRSS-Masters
instant: true
captureStart: true

- query: sum ( container_cpu_usage_seconds_total { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "infra" } ) by ( id )
metricName: cgroupCPUSeconds-Infra
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "infra" } ) by ( id )
metricName: cgroupMemoryRSS-Infra
instant: true
captureStart: true

- query: sum( container_cpu_usage_seconds_total{container!~"POD|",namespace=~"openshift-.*"} ) by (namespace)
metricName: cgroupCPUSeconds-namespaces
instant: true
captureStart: true

- query: sum( container_memory_rss{container!~"POD|",namespace=~"openshift-.*"} ) by (namespace)
metricName: cgroupMemoryRSS-namespaces
instant: true
captureStart: true
20 changes: 20 additions & 0 deletions cmd/config/metrics-egressip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,37 @@
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "worker",role != "infra" } ) by ( id )
metricName: cgroupMemoryRSS-Workers
instant: true
captureStart: true

- query: sum ( container_cpu_usage_seconds_total { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "master" } ) by ( id )
metricName: cgroupCPUSeconds-Masters
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "master" } ) by ( id )
metricName: cgroupMemoryRSS-Masters
instant: true
captureStart: true

- query: sum ( container_cpu_usage_seconds_total { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "infra" } ) by ( id )
metricName: cgroupCPUSeconds-Infra
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "infra" } ) by ( id )
metricName: cgroupMemoryRSS-Infra
instant: true
captureStart: true

- query: sum( container_cpu_usage_seconds_total{container!~"POD|",namespace=~"openshift-.*"} ) by (namespace)
metricName: cgroupCPUSeconds-namespaces
instant: true
captureStart: true

- query: sum( container_memory_rss{container!~"POD|",namespace=~"openshift-.*"} ) by (namespace)
metricName: cgroupMemoryRSS-namespaces
instant: true
captureStart: true
25 changes: 25 additions & 0 deletions cmd/config/metrics-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@
metricName: max-memory-sum-workers
instant: true

- query: sum( (node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes) and on (instance) label_replace(kube_node_role{role="worker"}, "instance", "$1", "node", "(.+)") )
metricName: memory-sum-workers
instant: true
captureStart: true

- query: avg(avg_over_time(sum(irate(node_cpu_seconds_total{mode!="idle", mode!="steal"}[2m]) and on (instance) label_replace(kube_node_role{role="infra"}, "instance", "$1", "node", "(.+)")) by (instance)[{{.elapsed}}:]))
metricName: cpu-infra
instant: true
Expand Down Expand Up @@ -393,17 +398,37 @@
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "worker",role != "infra" } ) by ( id )
metricName: cgroupMemoryRSS-Workers
instant: true
captureStart: true

- query: sum(container_cpu_usage_seconds_total{id=~"/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice"} and on (node) kube_node_role{role="master"}) by (id)
metricName: cgroupCPUSeconds-Masters
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "master" } ) by ( id )
metricName: cgroupMemoryRSS-Masters
instant: true
captureStart: true

- query: sum(container_cpu_usage_seconds_total{id=~"/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice"} and on (node) kube_node_role{role="infra"}) by (id)
metricName: cgroupCPUSeconds-Infra
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "infra" } ) by ( id )
metricName: cgroupMemoryRSS-Infra
instant: true
captureStart: true

- query: sum(container_cpu_usage_seconds_total{container!~"POD|",namespace=~"openshift-.*"}) by (namespace)
metricName: cgroupCPUSeconds-namespaces
instant: true
captureStart: true

- query: sum( container_memory_rss{container!~"POD|",namespace=~"openshift-.*"} ) by (namespace)
metricName: cgroupMemoryRSS-namespaces
instant: true
captureStart: true
20 changes: 20 additions & 0 deletions cmd/config/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,37 @@
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "worker",role != "infra" } ) by ( id )
metricName: cgroupMemoryRSS-Workers
instant: true
captureStart: true

- query: sum ( container_cpu_usage_seconds_total { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "master" } ) by ( id )
metricName: cgroupCPUSeconds-Masters
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "master" } ) by ( id )
metricName: cgroupMemoryRSS-Masters
instant: true
captureStart: true

- query: sum ( container_cpu_usage_seconds_total { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "infra" } ) by ( id )
metricName: cgroupCPUSeconds-Infra
instant: true
captureStart: true

- query: sum ( container_memory_rss { id =~ "/system.slice|/system.slice/kubelet.service|/system.slice/ovs-vswitchd.service|/system.slice/crio.service|/kubepods.slice" } and on (node) kube_node_role{ role = "infra" } ) by ( id )
metricName: cgroupMemoryRSS-Infra
instant: true
captureStart: true

- query: sum( container_cpu_usage_seconds_total{container!~"POD|",namespace=~"openshift-.*"} ) by (namespace)
metricName: cgroupCPUSeconds-namespaces
instant: true
captureStart: true

- query: sum( container_memory_rss{container!~"POD|",namespace=~"openshift-.*"} ) by (namespace)
metricName: cgroupMemoryRSS-namespaces
instant: true
captureStart: true

0 comments on commit bbffbc4

Please sign in to comment.