We would like to monitor docker container metrics parameters like CPU, network, memory etc. we are following https://docs.docker.com/articles/runmetrics/ and found that monitoring metrics is not enabled by default.
cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 1 7 1
cpu 2 7 1
cpuacct 3 7 1
memory 4 7 1
devices 5 7 1
As per the documentation we have to enable monitoring by setting up kernel parameters.
Memory Metrics: memory.stat
Memory metrics are found in the "memory" cgroup. Note that the memory control group adds a little overhead, because it does very fine-grained accounting of the memory usage on your host. Therefore, many distros chose to not enable it by default. Generally, to enable it, all you have to do is to add some kernel command-line parameters: cgroup_enable=memory swapaccount=1
Anyone knows how to set kernel parameters in docker container (Dockerfile or docker-compose.yml).
Thanks in Advance.