[QASource] Test collection of system process metrics under docker
- Dominant language
- Go
- Stars
- 12.7k
- Forks
- 5k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 370
Description
In the past months, we've run into a considerable amount of bugs when it comes to monitoring host metrics while running under docker. I'm making these test steps in the hope that this can be a regular set of tests that are run with every release.
## Steps to test
1) Run metricbeat via docker with the following:
```
docker run --label co.elastic.metrics/module=system \
--mount type=bind,source=/proc,target=/hostfs/proc,readonly \
--mount type=bind,source=/sys/fs/cgroup,target=/hostfs/sys/fs/cgroup,readonly \
--mount type=bind,source=/,target=/hostfs,readonly \
--mount type=bind,source=/var/run/dbus/system_bus_socket,target=/hostfs/var/run/dbus/system_bus_socket,readonly \
--env DBUS_SYSTEM_BUS_ADDRESS='unix:path=/hostfs/var/run/dbus/system_bus_socket' \
--net=host --cgroupns=host docker.elastic.co/beats/metricbeat:VERSION_TO_TEST metricbeat -e -E output.elasticsearch.hosts='[ES_ENDPOINT]' -d '*'
```
2) In elasticsearch, ensure that there are documents with `metricset.name` matching `process`
3) in the debug logs, ensure that there are no log lines that contain the strings:
- `Non fatal error fetching PID some info`
- `Error fetching PID info for`
- `GetInfoForPid:`
4) Repeat steps 1-3, but omit the `--cgroupns=host` config line:
```
docker run --label co.elastic.metrics/module=system \
--mount type=bind,source=/proc,target=/hostfs/proc,readonly \
--mount type=bind,source=/sys/fs/cgroup,target=/hostfs/sys/fs/cgroup,readonly \
--mount type=bind,source=/,target=/hostfs,readonly \
--mount type=bind,source=/var/run/dbus/system_bus_socket,target=/hostfs/var/run/dbus/system_bus_socket,readonly \
--env DBUS_SYSTEM_BUS_ADDRESS='unix:path=/hostfs/var/run/dbus/system_bus_socket' \
--net=host docker.elastic.co/beats/metricbeat:VERSION_TO_TEST metricbeat -e -E output.elasticsearch.hosts='[ES_ENDPOINT]' -d '*'
```
## Test Targets
This should be run under docker on linux, and preferably tested across a range of linux distros from our support matrix, at least:
- Ubuntu 16.04
- Ubuntu 20.04
- Ubuntu 24.04
- RHEL 7, 8, and 9, if possible.
Contributor guide
Assessment
This issue has not been assessed yet.