Open kevinsmithwrs opened 1 year ago
This issue doesn't have a Team:<team>
label.
Hi! We just realized that we haven't looked into this issue in a while. We're sorry!
We're labeling this issue as Stale
to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1
.
Thank you for your contribution!
I think the Initialization of userSet is missing in metricbeatInit in metricbeat/internal/sysinit/init.go. My understanding is we shouldn't need to set the deprecated --system.hostfs=/hostfs parameter when launching metricbeat, in favour of using the hostfs settings in the individual module metricsets (process, linux, etc) in 8.x. If I do this however, we end up missing some process metrics. The cause is the uninitialized userSet bool, (which then defaults to false) . This is incorrect if the hostfs module setting has been set. In a docker/kubernetes environment, the below check in metricbeat/module/system/process/process.go uses this (incorrect) false for sys.IsSet() resulting in the value for LIBBEAT_MONITORING_CGROUPS_HIERARCHY_OVERRIDE being used, which is set to '/' in the elastic metricbeat docker images thereby overriding the cgroup heirarchy.
As a workaround, I can get all process metrics to come out properly by setting the CLI flag, the proper /hostfs settings in the module, and setting LIBBEAT_MONITORING_CGROUPS_HIERARCHY_OVERRIDE to "" when launching the metricbeat container.
metricbeat/module/system/process/process.go:
Fix needed in metricbeat/internal/sysinit/init.go: