Skip to content

Conversation

@bingikarthik
Copy link

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds the container_spec_memory_limit_bytes metric to the CRI-O metrics suite, which reports the memory limit for containers in bytes. This metric is valuable for monitoring and alerting on memory configuration versus usage. It allows users to easily calculate memory usage percentages and visualize resource allocation versus consumption in monitoring systems like Prometheus and Grafana.

Which issue(s) this PR fixes:

Special notes for your reviewer:

The implementation follows the existing pattern for metrics in CRI-O. The new metric has been added to the "memory" metrics section and implemented in the generateSandboxMemoryMetrics function to collect memory limit data from cgroup stats.

Does this PR introduce a user-facing change?

None

Added new metric `container_spec_memory_limit_bytes` to display the memory limit of containers in bytes.

@bingikarthik bingikarthik requested a review from mrunalp as a code owner April 17, 2025 12:02
@openshift-ci openshift-ci bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Apr 17, 2025
@openshift-ci openshift-ci bot requested review from QiWang19 and klihub April 17, 2025 12:02
@openshift-ci openshift-ci bot added kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Apr 17, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 17, 2025

Hi @bingikarthik. Thanks for your PR.

I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 17, 2025
@openshift-ci openshift-ci bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Apr 17, 2025
@haircommander
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 17, 2025
@bitoku bitoku mentioned this pull request Apr 17, 2025
79 tasks
@bingikarthik
Copy link
Author

/retest

@codecov
Copy link

codecov bot commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.00%. Comparing base (a77066b) to head (7f22c7d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9140      +/-   ##
==========================================
- Coverage   47.00%   47.00%   -0.01%     
==========================================
  Files         161      161              
  Lines       23634    23634              
==========================================
- Hits        11109    11108       -1     
- Misses      11425    11426       +1     
  Partials     1100     1100              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bingikarthik
Copy link
Author

/retest

@bitoku
Copy link
Contributor

bitoku commented Apr 22, 2025

@bingikarthik Can you rebase and align it with the new way of writing?

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 22, 2025
@bingikarthik bingikarthik reopened this Apr 23, 2025
@openshift-ci openshift-ci bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. and removed dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Apr 23, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2025
@openshift-ci openshift-ci bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Apr 23, 2025
@bingikarthik
Copy link
Author

@bingikarthik Can you rebase and align it with the new way of writing?

The PR has been updated now. Could you please review the changes? Thanks..

Copy link
Contributor

@bitoku bitoku left a comment

Choose a reason for hiding this comment

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

Can you run make lint to fix the lint errors? I think the errors can be fixed just by running it.

@openshift-ci openshift-ci bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. and removed dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Apr 23, 2025
@openshift-ci openshift-ci bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Apr 23, 2025
@bitoku
Copy link
Contributor

bitoku commented Apr 23, 2025

Thanks! lgtm if the tests pass

@bitoku bitoku self-assigned this Apr 23, 2025
Signed-off-by: Bingi Narasimha Karthik <[email protected]>
Signed-off-by: Bingi Narasimha Karthik <[email protected]>
@bingikarthik
Copy link
Author

Thanks! lgtm if the tests pass

Could you please review, seems tests passed now except ci/prow/ci-e2e-evented-pleg which seems unrelated failure!

@bitoku
Copy link
Contributor

bitoku commented Apr 23, 2025

/lgtm

@cri-o/cri-o-maintainers PTAL

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2025
@haircommander
Copy link
Member

/override ci/prow/ci-e2e-evented-pleg
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 23, 2025

@haircommander: Overrode contexts on behalf of haircommander: ci/prow/ci-e2e-evented-pleg

In response to this:

/override ci/prow/ci-e2e-evented-pleg
/approve

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bingikarthik, haircommander

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 23, 2025
@bitoku
Copy link
Contributor

bitoku commented Apr 24, 2025

/retest

@openshift-merge-bot openshift-merge-bot bot merged commit 728f130 into cri-o:main Apr 24, 2025
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants