Conversation
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label. Could you fix it @jsvd? 🙏
|
|
run exhaustive tests |
Separate CGroupV2Resources from CGroupResources for cleaner v1/v2 separation. Try v1 first, fall back to v2 with labeled debug logging.
|
run exhaustive tests |
Detect v1 or v2 on first call and cache the result, avoiding repeated "required cgroup files or directories not found" debug messages.
|
run exhaustive tests |
|
|
||
| private | ||
|
|
||
| def resolve_v2_path |
There was a problem hiding this comment.
Will this be called often? Should we set an instance variable once then use that for subsequent calls?
donoghuc
left a comment
There was a problem hiding this comment.
Verified by building a container with this branch:
debug log:
[2026-03-20T19:56:53,429][DEBUG][logstash.instrument.periodicpoller.cgroup] using cgroupv2
/_node/stats/os
{
"os": {
"cgroup": {
"cpuacct": {
"control_group": "/",
"usage_nanos": 20372769000
},
"cpu": {
"stat": {
"number_of_times_throttled": 0,
"number_of_elapsed_periods": 0,
"time_throttled_nanos": 0
},
"control_group": "/",
"cfs_quota_micros": -1,
"cfs_period_micros": 100000
}
}
}
}
Left a question/suggestion to "cache" result from a method in an instance var, but its not a blocker. The implementation looks solid 👍
|
run exhaustive tests |
| private | ||
|
|
||
| def resolve_v2_path | ||
| @v2_path ||= read_v2_path |
donoghuc
left a comment
There was a problem hiding this comment.
Looks like we need to manage that state in tests. I tested these suggestions locally and it worked.
| described_class.instance_variable_set(:@resolved, false) | ||
| described_class.instance_variable_set(:@active_resources, nil) | ||
| described_class.instance_variable_set(:@active_label, nil) | ||
| described_class.instance_variable_set(:@logged_empty, false) |
There was a problem hiding this comment.
| described_class.instance_variable_set(:@logged_empty, false) | |
| described_class.instance_variable_set(:@logged_empty, false) | |
| Cgroup::CGROUP_V2_RESOURCES.instance_variable_set(:@v2_path, nil) |
💛 Build succeeded, but was flaky
Failed CI StepsHistory
|
|
run exhaustive tests |
With ubuntu 24.04 dropping support for cgroupsv1, it's ideal for Logstash to support cgroupsv2, as other parts of the Stack already do too.
This change introduces cgroupsv2 support and testing for it.
I tested this in a ubuntu 24.04 vm on gcp:
And we can see the result of the stack monitoring metrics before the change (no cgroup data):
Logs show error in capturing cgroup data:
And with this changeset:
No more error in logs:
Also still works with v1:
fixes #14534