process-exporter
process-exporter copied to clipboard
Fix recheck on processes which are already grouped
-recheck already allows process_exporter to put processes which might change name after they start in the right group. However this only works if the initial process name is not matched. In case a matcher catches it early, the process is left in its old group after its name changes.
This can be observed with a generic configuration like this:
process_names:
- name: "{{.Comm}}"
cmdline:
- '.+'
If a process called process1 with PID 1234 starts and later execs and changes its name to process2, then 1234 remains in the process1 group even though it should now be in a new process2 group.
This PR removes the assumption that GetStatic is static, and instead retrieves and updates it at each scrape. I believe this should not have any noticeable performance hit?
- if
recheck(orrecheck-with-time-limit) is enabled, the process is allowed to change groups after it has started - if the new process name is no longer matched by the namer, the process is ignored
I'm not sure about that last behavior: is it
Updatethe right place to do it? Could it break tracking of child processes?