-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(inputs.procstat): Allow multiple selection criteria #14948
Conversation
He, Haven't test it, but It seems correct overall. I doesn't see how the "pgrep" mode work ? The Filter should have more criterias : It's difficult because de multifilter is only available for : It's strange to agregate multi filter values in the procstat metrics ? Thanks |
@tguenneguez I would love to get some help from you to implement the missing filters. This was meant as a proof-of-concept and is not finished yet... So please feel free to push to my PR! Regarding |
100% agree with you. |
Before complete your job, there are things to clarify. The "name" should be add by [inputs.procstat.tags]. I also think you will have in one part : Indeed, the first filters are already very restrictive and I don't think there is any point in combining them. Besides, the implementation does use "pid_finder". In filter, I would only implement the filters: Name is the content of /proc//comm In Filters, it seem's to define some filters as a liste... looking forward to reading you |
Thanks @tguenneguez for your comments! I'm trying to answer one-by-one:
The user has to have some ability to find out which of the potentially multiple filters produced the data, so I think we need to add the filter name. If you don't like
Why do you want to add this limitation? Imagine you want to monitor 4 different systemd units but only certain child processes or different users. In your scheme, this means four different plugin instances for no good reason...
This might be true for your use-cases but I know that people are looking for combining those to monitor only partial aspects...
I'm not against having name and exe, but please also think about other operating systems such as Windows or MacOS.
In fact, all filters are lists! Each entry, i.e. I hope this clarifies some points!? |
@tguenneguez have you had a chance to look over @srebhan's response above? Were you going to update your existing PR based on this? |
I will see when I will have time but not for the moment sorry |
f2f4dd8
to
eca1020
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, the new findByPidFiles
where you verify if the PID exists would be good for #15017.
Made a couple small changes to sample conf & readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Will leave to you to merge after resolving the review comments
Co-authored-by: Joshua Powers <powersj@fastmail.com>
Co-authored-by: Joshua Powers <powersj@fastmail.com>
Co-authored-by: Joshua Powers <powersj@fastmail.com>
Co-authored-by: Joshua Powers <powersj@fastmail.com>
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
Summary
This PR adds the possibility to specify multiple filter expressions for the process list. Each filter is independent of the other ones, intra-criterion lists are combined using logical or whereas different criteria are combined via logical and.
Checklist
Related issues
resolves #6174