The code path for -children=false failed to ignore unmatched processes as that logic was only triggered from checkAncestry(), which isn't called in that case.
Properly ignore all unmatched processes when using -children=false.
I've discovered this while tracking down performance problems and thought that -children=false should lead to better performance. However, it didn't, because process-exporter continuously kept gathering full metrics (status, io, tasks) from unrelated processes such as PID 1.
The code path for
-children=false
failed to ignore unmatched processes as that logic was only triggered from checkAncestry(), which isn't called in that case.Properly ignore all unmatched processes when using
-children=false
.I've discovered this while tracking down performance problems and thought that
-children=false
should lead to better performance. However, it didn't, because process-exporter continuously kept gathering full metrics (status, io, tasks) from unrelated processes such as PID 1.