ncabatoff / process-exporter

Prometheus exporter that mines /proc to report on selected processes
MIT License
1.7k stars 269 forks source link

Remove process group when namedprocess_namegroup_num_procs = 0 #282

Closed zviRosenfeldRedis closed 3 months ago

zviRosenfeldRedis commented 11 months ago

I'm tracking processes that die after a while, and are never expected to come back. So I don't want these process groups to appear in the stats once the process dies. But in practice I continue seeing it (and namedprocess_namegroup_num_procs for it is 0). It only disappears when I restart process-exporter. Is there a way I can cause the process group to disappear when namedprocess_namegroup_num_procs for it is 0?

zviRosenfeldRedis commented 11 months ago

Update: I merged a fix for this into a fork: https://github.com/RedisLabs/process-exporter. I added a flag remove-empty-groups, and if that flag is true we forget any group with no processes (default is false).

I also opened a PR back upstream to with my fix, but seeing how this repository wasn't updated since 2021, I doubt it's ever getting it...

Alex-wwei commented 11 months ago

It seems to have been removed, but as time went on, the exporter's memory footprint increased.

zviRosenfeldRedis commented 11 months ago

I pushed a fix into the repository that probably fixed the issue. (into this repository: https://github.com/RedisLabs/process-exporter). @Alex-wwei, can you confirm if the bug was indeed fixed?

Alex-wwei commented 11 months ago

I pushed a fix into the repository that probably fixed the issue. (into this repository: https://github.com/RedisLabs/process-exporter). @Alex-wwei, can you confirm if the bug was indeed fixed?

@zviRosenfeldRedis It`s much better now, But there may still be a slight increase in memory due to the constant changes in the process。