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
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
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:
- 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
- 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
- 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?