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

shim: add support for containerd v2 metrics #11473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Champ-Goblem
Copy link
Contributor

Add support for v2 containerd metrics in the shim, v2 metrics are only used when runsc is run with --system-cgroup=true. Containerd requires v2 metrics when the host is run with CGroupsV2. This issue was noticed when attempting to gather metrics on AL2023 which defaults to CGroupsV2.

Fixes: #11472

Add support for v2 containerd metrics in the shim, v2 metrics are only used when runsc is run with --system-cgroup=true.
Containerd requires v2 metrics when the host is run with CGroupsV2.
This issue was noticed when attempting to gather metrics on AL2023 which defaults to CGroupsV2.

Fixes: google#11472
Signed-off-by: Champ-Goblem <[email protected]>
@Champ-Goblem
Copy link
Contributor Author

Testing this change on AWS AL2022 vs AL2023:

image

Commands used for testing:

CPU: stress-ng -c 1
Memory: stress-ng --vm 1 --vm-bytes 100M

The difference between runC and gVisor might be a separate issue.

@ayushr2
Copy link
Collaborator

ayushr2 commented Feb 13, 2025

Thanks for the PR!

@@ -49,7 +51,7 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/cleanup"
"gvisor.dev/gvisor/pkg/shim/runtimeoptions/v14"
v14 "gvisor.dev/gvisor/pkg/shim/runtimeoptions/v14"
Copy link
Contributor

Choose a reason for hiding this comment

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

it is not needed

@milantracy
Copy link
Contributor

thanks for the patch! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shim: Add support for cgroups v2 stats
3 participants