Hey Aurélien, I'm not sure if using cadvisor is a hard requirement for you, but might I suggest checking out Snap[0]? I recently wrote a Mesos metrics collector[1] that enumerates all running containers on an agent, in addition to other higher level resource utilization metrics (per agent, per framework, etc). All of this data is then published into a backend of your choosing. There's also a Vagrantfile[2] in the repo if you want to play around with it a bit.
Note there's currently an open issue[3] to map the human-readable framework name with the individual tasks (marathon, chronos, jenkins, etc instead of the UUID). Since this is side project for me I just haven't made the time to work on this feature yet. Feel free to chime in on the ticket if that's something you're interested in! [0] https://github.com/intelsdi-x/snap [1] https://github.com/intelsdi-x/snap-plugin-collector-mesos [2] https://github.com/intelsdi-x/snap-plugin-collector-mesos/blob/master/Vagrantfile [3] https://github.com/intelsdi-x/snap-plugin-collector-mesos/issues/26 I hope that helps! -- Roger On Fri, Jul 29, 2016 at 7:30 AM, [email protected] < [email protected]> wrote: > Hello. > > > For example: > > proc/113197/task/113197 > [root@opvaames06 113197]# cat cgroup > 10:devices:/ > 9:perf_event:/ > 8:freezer:/mesos/3af01ccb-ace4-4467-84e9-1e6ae28d6dd7 > 7:memory:/mesos/3af01ccb-ace4-4467-84e9-1e6ae28d6dd7 > 6:cpuset:/ > 5:net_cls:/ > 4:cpuacct,cpu:/mesos/3af01ccb-ace4-4467-84e9-1e6ae28d6dd7 > 3:hugetlb:/ > 2:blkio:/ > 1:name=systemd:/mesos_executors.slice > > First line: 10: devices:/. > > From a mail on the cadvisor mailing list: > cAvisor uses `ps` to group processes into cgroups. `ps` uses `devices` > cgroups to identify the cgroups of a process. In your case, devices cgroup > is still set to root `/`. > > Thanks for the answer. > ------------------------------ > *De :* haosdent <[email protected]> > *Envoyé :* vendredi 29 juillet 2016 16:21:07 > *À :* user > *Objet :* Re: Cadvisor and Mesos: cgroup monitoring > > >- is there a way to "link" the cgroup id to the mesos task id? > The cgroup id you saw is the ContainerId actually. You could get the > mapping relations from querying the state endpoint of Mesos agent. > > >In mesos, this information is set to /, so all my process are shown in > the / cgroup. > May you mind provide more details about this? As I know, all the mesos > containers should under `Flags::cgroups_root` which default value is > "mesos". > > In additionally, do you ever try the `/metrics/snapshot` endpoints of > Mesos Master and Mesos Agent, which provide some useful messages could used > to monitor as well. > > On Fri, Jul 29, 2016 at 10:07 PM, [email protected] < > [email protected]> wrote: > >> >> >> >> Hello. >> >> >> I'm trying to find a solution to monitor the real usage of my mesos >> tasks. I don't use docker at all, but I gave a look to cadvisor. >> >> >> Unfortunatly, cadvisor uses ps and the device information to determine >> the cgroup ownership of a process. In mesos, this information is set to /, >> so all my process are shown in the / cgroup. >> >> >> I can monitor the usage of the cgroups however, but I have no clue of >> which process are inside, and the cgroup name is not related to the taskid >> in mesos. >> >> >> So, 3 questions: >> >> - is anybody managed to use cadvisor (with ou without mesos) for cgroups? >> >> - is there a "better" solution ? >> >> - is there a way to "link" the cgroup id to the mesos task id? >> >> >> Thanks for any clue. >> >> >> And a good sysadmin appreciation day! >> >> >> Aurélien. >> >> > > > -- > Best Regards, > Haosdent Huang >

