I run Metricbeat in container and it seems Metricbeat collects system metrics from its container and not the host machine. On imported Kibana system dashboards there is only one host with the name equal to the container id and only one process that is metricbeat itself.
Here is my docker compose file for metricbeat:
metricbeat:
image: docker.elastic.co/beats/metricbeat:6.6.0
user: root
volumes:
- "${MB_CONF_PATH}/metricbeat.docker.yml:/usr/share/metricbeat/metricbeat.yml:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro"
- "/proc:/hostfs/proc:ro"
- "/:/hostfs:ro"
And system module config:
metricsets:
- cpu
- load
- memory
- process
- process_summary
- uptime
enabled: true
period: 10s
processes: ['.*']
cpu.metrics: ["percentages"]
process.include_top_n:
enabled: true
by_cpu: 10
by_memory: 10
It seems that only uptime metric is obtained from the host. So, what can be the case?