windows_exporter icon indicating copy to clipboard operation
windows_exporter copied to clipboard

Feature - Improve filters for processes collector

Open gillg opened this issue 4 years ago • 2 comments

Hello,

I would be able to chose dynamicaly process metrics to collect instead / in addition of whitelist, blacklist.

The idea would be to add a filter based on one of the metrics, with a thresold, and a topK process matching. I don't know what is possible with WMI queries, or if we have to getall metrics then order + slice in go.

Possible config :

collectors:
  # Adapt collectors to enable
  enabled: process

collector:
  process:
    filters:
      windows_process_working_set_bytes: 
        # all process above 2g
        min_thresold: 2g
        # only ten first
        limit: 10
      # implicit OR ?
      windows_process_thread_count:
        min_thresold: 300
        limit: 5

Any other ideas are welcome... To monitor the CPU, it seems more complicated (not realistic ?) because we only have a CPU total time, except if you are aware of a perfcounter for percentage.

Any idea on the feasability ? Anyone with some knowlegde on WMI ?

gillg avatar Oct 21 '21 08:10 gillg

Apologies for the large delay in responding to this!

We currently use Perflib as the metric source for the process collector, and I don't think it would be prohibitively difficult to implement the proposed filtering.

Would you like to submit a Pull Request for this? If not I may be able to get to this in the next couple of weeks.

breed808 avatar Dec 25 '21 00:12 breed808

Hello ! No worries for the delay, I'm not enough comfortable with perflib and Golang to propose a PR, but glad to hear it seems not really difficult. I take any additional ideas for the config format. I don't know if a list instead of map under "filters" could make sense to allow multiple OR filters on the same metric.

gillg avatar Dec 25 '21 09:12 gillg

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

github-actions[bot] avatar Nov 25 '23 02:11 github-actions[bot]