# Wrong process contacted by Metricbeat inside Docker container

**URL:** <https://discuss.elastic.co/t/wrong-process-contacted-by-metricbeat-inside-docker-container/382855>\
**Category:** Beats\
**Tags:** docker, metricbeat\
**Created:** [October 21, 2025, 7:29am UTC](https://discuss.elastic.co/t/wrong-process-contacted-by-metricbeat-inside-docker-container/382855 "2025-10-21T07:29:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucaCigarini](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@lucaCigarini](https://discuss.elastic.co/u/lucaCigarini)\
**Post date:** [October 21, 2025, 7:29am UTC](https://discuss.elastic.co/t/wrong-process-contacted-by-metricbeat-inside-docker-container/382855/1 "2025-10-21T07:29:25Z")

</div>

Hello, recently I've upgraded a containerized version of Metricbeat from 9.1.3 to 9.1.5. Since then, unfortunately, I am experiencing errors while using the system module to fetch the host CPU usage.This is the docker-compose.yaml snippet where Metricbeat is configured

```auto
    metricbeat:
        container_name: ns_metricbeat
        image: elastic/metricbeat:9.1.5
        hostname: metricbeat
        restart: on-failure
        network_mode: host
        cap_add:
            - NET_ADMIN
        volumes:
            - ./config/metricbeat/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
            - ./config/metricbeat/modules.d:/usr/share/metricbeat/modules.d:ro
            - /proc:/hostfs/proc:ro
            - /sys:/hostfs/sys:ro
            - /:/hostfs:ro
        command:
            - --system.hostfs=/hostfs
        healthcheck:
            disable: true

```

Below the metricbeat.yml and the system.yml respectively

```auto
name: "shinji"

logging.level: info
logging.to_stderr: true

# Reference: https://www.elastic.co/docs/reference/beats/metricbeat/metricbeat-configuration-reloading
metricbeat.config:
  modules:
    path: ${path.config}/modules.d/*.yml
    reload.enabled: false

# Reference: https://www.elastic.co/docs/reference/beats/metricbeat/elasticsearch-output
output.elasticsearch:
  hosts: ["https://elasticsearch:443"]
  username: "dummy"
  password: "dummy"

```

system.yml:

```auto
 - module: system
   metricsets:
     - cpu # CPU usage
     - load # CPU load averages
     - network
 
   interfaces: ['eno2', 'eno4', 'eno3']
 
   enabled: true
   period: 300s
   processes: ['.*']

```

The errors I am facing are the following:

- message: `Error retrieving CPU percentages: open /hostfs/proc/7/stat: no such file or directory` - function: [`github.com/elastic/elastic-agent-system-metrics/report.InstanceCPUReporter.func1`](http://github.com/elastic/elastic-agent-system-metrics/report.InstanceCPUReporter.func1) - file name: `report/report.go`

- message: `Error while retrieving open FDs information: %vopen /hostfs/proc/7/fd: no such file or directory` - function: [`github.com/elastic/elastic-agent-system-metrics/report.FDUsageReporter.func2`](http://github.com/elastic/elastic-agent-system-metrics/report.FDUsageReporter.func2) - file name: `report/metrics_file_descriptors.go`

It looks like Metricbeat is trying to read CPU and FD data for its process on the **real host rather than inside the container**.Could you help me with this? Is this a bug?
