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

Read all cgroup v2 metrics that can be read #1120

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

blt
Copy link
Collaborator

@blt blt commented Dec 3, 2024

What does this PR do?

This commit removes any arbitration of the cgroup v2 heirarchy for a
given process. We instead read anything that can be read, looping over
all cgroup files present but not following the hierarchy down.

Metric names will change but they will now reflect underlying system reality.

@blt blt added the no-changelog label Dec 3, 2024 — with Graphite App
Copy link
Collaborator Author

blt commented Dec 3, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@blt blt mentioned this pull request Dec 3, 2024
@blt blt marked this pull request as ready for review December 3, 2024 03:46
@blt blt requested a review from a team as a code owner December 3, 2024 03:46
@blt blt force-pushed the blt/update_procfs_to_0.17 branch from 63f1ce0 to 3f145ec Compare December 3, 2024 17:35
@blt blt force-pushed the blt/read_all_cgroup_v2_metrics_that_can_be_read branch from b4b6486 to 2a32d9b Compare December 3, 2024 17:35
lading/src/observer/linux.rs Outdated Show resolved Hide resolved
mem_stat.stat.total_inactive_file
};
let usage = mem_stat.usage_in_bytes;
let working_set = if usage < inactive_file {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we preserve working_set calculation as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh hmm. So in the new cgroup sampler we never actually inspect any of the data being read, just immediately rip it out to metrics. I think we could calculate this easily enough in-platform or we could make a special read to preserve this.

Happy to move forward with either, but you're right. working_set won't be present in the new telemetry stream.

Base automatically changed from blt/update_procfs_to_0.17 to main December 3, 2024 22:27
This commit removes any arbitration of the cgroup v2 heirarchy for a
given process. We instead read anything that can be read, looping over
all cgroup files present but not following the heirarchy down.

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
This commit splits the Sampler so that cgroup collection is in a separate
implementation from procfs, which has gotten sprawling. I have maintained the
existing Sampler interface and hidden the two new implementations inside of it,
although we might choose to expose them at some point in the future.

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
@blt blt force-pushed the blt/read_all_cgroup_v2_metrics_that_can_be_read branch from 8adc60d to 6b05a98 Compare December 3, 2024 22:57
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants