Closed igorwwwwwwwwwwwwwwwwwwww closed 2 years ago
There is already the -recheck
flag that means it will always check this again.
See also #23 for an option to only recheck for a certain time...
@flixr Oh amazing, -recheck
is exactly what I wanted. Thanks!
Closing. :)
TLDR
process-exporter tracks the procname for a process the first time it sees it. If that process then performs an
execve
we do not reconsider it. This leads to processes being ignored even if they would later become matching.Background
I ran into this while attempting to add
process-exporter
as a sidecar to thebitnami/redis
helm chart (downstream issue).That chart has a
start-node.sh
wrapper script that runs some checks before eventually performing anexec redis-server
.Problem
Running
process-exporter -procnames redis-server
did not match anything. By changing this toprocess-exporter -procnames start-node.sh
I was able to get it working. But now the group name isstart-node.sh
, which is quite misleading and may also be susceptible to race conditions.Potential workarounds and solutions
Define regex that matches both
start-node.sh
andredis-server
Something like this may be the most viable workaround given the current implementation:
I still need to verify that this works.
Delay start of
process-exporter
A hack I thought about was delaying
process-exporter
. However, because the docker image is builtFROM scratch
it does not include a shell.This makes it impossible to do something like:
It could be added as a feature to the go binary, but it's extremely hacky to begin with.
Periodically re-evaluate all processes
If
process-exporter
were to periodically re-evaluate whether processes (both matched and unmatched) actually should match, it could better respond to the presence ofexecve
, and perhaps change its mind after an initial bad impression.This seems like the most "correct" solution. However, I don't know how easy this would be to do, and how expensive it would be.