Fix recheck on processes which are already grouped #350
+82
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-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:
If a process called
process1
with PID 1234 starts and later execs and changes its name toprocess2
, then 1234 remains in theprocess1
group even though it should now be in a newprocess2
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?recheck
(orrecheck-with-time-limit
) is enabled, the process is allowed to change groups after it has startedI'm not sure about that last behavior: is it
Update
the right place to do it? Could it break tracking of child processes?