# Metricbeat System Module shows docker container metrics instead of host

**URL:** https://discuss.elastic.co/t/metricbeat-system-module-shows-docker-container-metrics-instead-of-host/168062
**Category:** Beats
**Tags:** docker, metricbeat
**Created:** [February 12, 2019, 3:10pm UTC](https://discuss.elastic.co/t/metricbeat-system-module-shows-docker-container-metrics-instead-of-host/168062 "2019-02-12T15:10:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Cyril\_Silver](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@Cyril\_Silver](https://discuss.elastic.co/u/Cyril_Silver)
#### Post date: [February 12, 2019, 3:10pm UTC](https://discuss.elastic.co/t/metricbeat-system-module-shows-docker-container-metrics-instead-of-host/168062/1 "2019-02-12T15:10:37Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [February 14, 2019, 3:58pm UTC](https://discuss.elastic.co/t/metricbeat-system-module-shows-docker-container-metrics-instead-of-host/168062/2 "2019-02-14T15:58:29Z")

</div>

I assume you copied most of the config from here? [https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-docker.html](https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-docker.html)

It definitively sound strange that only the uptime should come from the host. Could you try to run just a docker container without compose with the flags described in the blog post and see what is happening?

Can you share 1-2 of the events?

---

<div class="post-metadata">

### Author: ![Cyril\_Silver](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@Cyril\_Silver](https://discuss.elastic.co/u/Cyril_Silver)
#### Post date: [February 18, 2019, 8:06am UTC](https://discuss.elastic.co/t/metricbeat-system-module-shows-docker-container-metrics-instead-of-host/168062/3 "2019-02-18T08:06:00Z")

</div>

The flag `-system.hostfs=/hostfs` solved the problem. Thanks

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 18, 2019, 8:06am UTC](https://discuss.elastic.co/t/metricbeat-system-module-shows-docker-container-metrics-instead-of-host/168062/4 "2019-03-18T08:06:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
