Metricbeat - Docker Container stats in Mesos DCOS

Does anyone have best practice for sending Elastic Docker stats from containers running in DCOS on CentOS? I'm running Elastic 5.2.2. I see some discussion with using filebeat, but i'm interested in the cpu & mem usage of each container and think I should be using metricbeat instead. Anyone accomplish this and/or have specific guidance to accomplish this? Any info would be much appreciated.

Hi @jruzicka,

You may want to have a look to Metricbeat Docker module:, it can retrieve the info you want from Docker.

Also check on how to run metricbeat on top of Docker.

Ideally you would launch a metricbeat container per host, so it can monitor all local containers

Thank you. I was able to get metricbeat running on one of our agents in a DCOS cluster. Are you familiar with DCOS and container metrics? For instance I believe I see cgroup system.process.cgroup.memory.mem.usage.bytes on container tasks that contradict docker stats memory values as well as contradicts the mem setting that was allocated to the dcos service.

Could you please elaborate? It would be useful if you share the exact metrics & values that seem wrong

Sure thing. Thanks for looking into this. I am running DCOS 1.9.2, Elastic 5.2.2

When running "docker stats" on the private agent it returns a number of containers this is one for example:
9bf5e111541f 0.06% 253.8 MiB / 256 MiB mesos-9e706938-*******

I then went into DCOS and reviewed the stdout files for each Docker task running and identified the specific dcos service container that the above mesos-* name value represents. DCOS has 256MiB set for this service. So I was thinking this looks good.

The next step is what I'm not so sure about.
I put a metricbeat on the same private node. The metricbeat.yml is pretty simple it is:

-module: system
metricsets: [process]
cgroups: true
enabled: true
period: 30s
processes: ['.*']

I found this at:

This sends a lot of information into Elastic and I only ran it for a minute.

In Kibana I queried to find the = "docker" and excluded other's that might have docker in the value such as: "mesos-docker-ex" and "docker-proxy" and "docker-containe"

The resulting docs I was able to find the service i'm interested in in the field: system.process.cmdline. On this same doc the field: system.process.cgroup.memory.mem.usage.bytes has the value: 538,157,056

I was expecting to see 253.8MB as shown in docker stats. Maybe i'm not understanding the cgroup values correctly.

I found this post which makes me think there might be an issue with DCOS memory limits on Docker containers.

I also read that Docker will take more memory then allocated if you do not specify a memory max in your docker-compose.yml - which I have not.

Any information would be greatly appreciated.

I think it's better if you use docker memory metricset, like:

- module: docker
    - memory

Check this for a list of fields you should get:

Thank you, I have this working as you recommended. I feel like with metricbeat I can get just as much detail as I can with DockBeat. Is there some benefit of Dockbeat that maybe i'm missing?

I haven't used Dockbeat but from what I see in I think most of it is already covered by Metricbeat

This topic was automatically closed after 21 days. New replies are no longer allowed.