I want to monitor a specific cgroup

Problem/Question

I created a cgroup (/users.slice/limited-users) into which some heavy hitting processes are moved. I limited the processor weight and RAM usage so they don’t crash my little server. Now I want to monitor this specific cgroup.

Relevant docs you followed/actions you took to solve the issue

I tried to use the groups plugin to do this.
Used Guide: Monitor Cgroups (cgroups.plugin) | Learn Netdata
Used default values to iterate on: netdata/collectors/cgroups.plugin/sys_fs_cgroup.c at a4388eb84d5916c011c1c0bceef5e1835c3bd4b7 · netdata/netdata · GitHub
Sadly this guide only really describes how to monitor docker containers, which probably is by far the most used feature of this plugin, and I can’t get it to collect the usage data of my ‘custom’ cgroup
I tried a lot of stuff and my last try looks like this:

[plugin:cgroups]
    search for cgroups in subpaths matching = /user.slice/limited-users !*/init.scope !*-qemu !*.libvirt-qemu !/init.scope !/system !/systemd !/user !/user.slice !/lxc/*/* !/lxc.monitor !/lxc.payload/*/* !/lxc.payload.* *
    enable by default cgroups names matching =  *

Can someone help me to get the monitoring for the cgroup /users.slice/limited-users working?

Hello @potatojuicemachine ,

I use cgroup plugin to collect data from vagrant VM as well, so I have few questions to understand the issue better, because it looks like we have a bug:

  • What is your distribution and kernel version?
  • Can you see any message inside /var/log/netdata for your cgroup?

Best regards!

Hi Thiago,

thank you for looking at my problem.
The distro is Ubuntu and the kernel is 5.19.0-38-generic.
I looked at all log documents inside the /var/log/netdata folder and i actually found an entry in one of the collector.log from some days ago. "cgroup-name.sh: INFO: cgroup ‘user.slice_limited-users’ is called ‘user.slice_limited-users’, labels ‘’ ". So at some point my settings worked. I am going to try to find out what of my settings worked and post it as answer or post an other reply if I still have problems. Thank you for pointing me into the right direction :slight_smile: .

I wish there would be a ‘monitor cgroup = ’ option.

With kind regards!

Hi,
this is the solution I found:

[plugin:cgroups]
    search for cgroups in subpaths matching = /user.slice/limited-users !/user.slice/limited-users/* !/user.slice/* !*/init.scope !*-qemu !*.libvirt-qemu !/init.scope !/system !/systemd !/user !/lxc/*/* !/lxc.monitor !/lxc.payload/*/* !/lxc.payload.* *
    enable by default cgroups names matching = user.slice_limited-users

I added this part /user.slice/limited-users !/user.slice/limited-users/* so the plugin searches for the group, but not in the group itself.

1 Like