Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ContainerHighCpuUtilization - it originally warns if a container uses 0.8 core, this PR makes it warn if it uses 80% of cgroup cpu limit #367

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _data/rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ groups:
This rule can be very noisy in dynamic infra with legitimate container start/stop/deployment.
- name: Container High CPU utilization
description: Container CPU utilization is above 80%
query: '(sum(rate(container_cpu_usage_seconds_total{name!=""}[3m])) BY (instance, name) * 100) > 80'
query: '(sum(rate(container_cpu_usage_seconds_total{pod!=""}[3m])) by (instance, pod) / sum(container_spec_cpu_quota / container_spec_cpu_period) by (instance, pod) * 100) > 80'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI:
i am running container with docker and the metric from cadvisor does not have the label "pod" on my instance.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you running containers in k8s ?

In my setup, out of k8s, I see "name" instead of "pod".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I am running in k8s; not knowing what @Kariton is running on)

Copy link

@Kariton Kariton Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like i need to clarify. 😄

I run it on docker - not k8s.
I know that someone could run docker under the hood of k8s.
but i run just a straight up plain docker instance.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so i also have "name" instead of "pod".

severity: warning
for: 2m
- name: Container High Memory usage
Expand Down