Skip to content

Conversation

@saschagrunert
Copy link
Member

@saschagrunert saschagrunert commented Aug 13, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

Reuse monitor_env to pass down the options to the pod runtime (conmon-rs).

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

Added support for conmon-rs log driver and heaptrack config by using the `monitor_env` runtime configuration.

@saschagrunert saschagrunert requested a review from mrunalp as a code owner August 13, 2025 09:17
@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Aug 13, 2025
@openshift-ci openshift-ci bot requested review from hasan4791 and klihub August 13, 2025 09:18
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 13, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saschagrunert

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 Aug 13, 2025
@codecov
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 22.72727% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.25%. Comparing base (e8f7645) to head (cc10ee3).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9402      +/-   ##
==========================================
+ Coverage   67.22%   67.25%   +0.02%     
==========================================
  Files         201      202       +1     
  Lines       27718    27781      +63     
==========================================
+ Hits        18634    18684      +50     
- Misses       7533     7542       +9     
- Partials     1551     1555       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@saschagrunert
Copy link
Member Author

/retest

// MonitorHeaptrackOutputPath is the path to output heaptrack profiles
// generated by the container monitor. Works only for the "pod"
// runtime_type and creates profiles per pod.
MonitorHeaptrackOutputPath string `toml:"monitor_heaptrack_output_path,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

hmm any ways we could make this more generic?

Copy link
Member

Choose a reason for hiding this comment

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

MonitorExtraBinaries or something? and then the runtime interprets? could be key->value.. i dunno

Copy link
Member Author

@saschagrunert saschagrunert Aug 14, 2025

Choose a reason for hiding this comment

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

Some generic monitor_options? Then we could enable heaptrack via monitor_options=heaptrack_output=/path/to,heaptrack_binary=/foo/bar. We could also just use the existing monitor_env then, which is unused for conmon-rs right now.

Edit: Switched over to reuse monitor_env.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO we don't necessarily have the common options for conmon and conmon-rs.
conmon-rs is already quite different from conmon, and if we continue to add new options, I'm concerned more about the maintainability like parsing each option, similar options but different format between them etc.
I'd want separate configs for conmon and conmon-rs. It also helps users understand what feature is supported by the container monitors.

It's not blocking the change though.

@saschagrunert saschagrunert force-pushed the conmonrs-heaptrack-log-level branch 3 times, most recently from d777086 to a1c4d6a Compare August 14, 2025 07:43
@saschagrunert saschagrunert changed the title Add support for monitor_heaptrack_output_path and monitor_log_driver Add support for conmon-rs log driver and heaptrack config Aug 14, 2025
@saschagrunert saschagrunert force-pushed the conmonrs-heaptrack-log-level branch from a1c4d6a to 87dccbb Compare August 14, 2025 07:46
@saschagrunert
Copy link
Member Author

/test ci-e2e-conmonrs

@saschagrunert
Copy link
Member Author

@cri-o/cri-o-maintainers PTAL

@saschagrunert
Copy link
Member Author

/retest

@saschagrunert
Copy link
Member Author

@bitoku @haircommander PTAL

Comment on lines 78 to 85
case "HEAPTRACK_OUTPUT":
heaptrack.Enabled = true
heaptrack.OutputPath = filepath.Join(keyVal[1], "cri-o.conmon-rs."+c.ID())

case "HEAPTRACK_BINARY_PATH":
heaptrack.Enabled = true
heaptrack.BinaryPath = keyVal[1]

Copy link
Contributor

Choose a reason for hiding this comment

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

what if one of them is specified? Do we need the validation or delegate it to conmonClient?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer to let conmon-rs client do that validation and just pass down the variables.

@saschagrunert saschagrunert force-pushed the conmonrs-heaptrack-log-level branch from 87dccbb to 9f1a1ee Compare August 19, 2025 07:36
Reuse `monitor_env` to pass down the options to the pod runtime (conmon-rs).

Signed-off-by: Sascha Grunert <[email protected]>
@saschagrunert saschagrunert force-pushed the conmonrs-heaptrack-log-level branch from 9f1a1ee to cc10ee3 Compare August 19, 2025 08:14
@bitoku
Copy link
Contributor

bitoku commented Aug 28, 2025

/lgtm
/retest

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 28, 2025
@saschagrunert
Copy link
Member Author

/test ci-cgroupv2-e2e-crun

@saschagrunert
Copy link
Member Author

/retest

@openshift-merge-bot openshift-merge-bot bot merged commit 5faaf01 into cri-o:main Aug 29, 2025
87 of 104 checks passed
@saschagrunert saschagrunert deleted the conmonrs-heaptrack-log-level branch September 1, 2025 07:38
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. 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.

3 participants