-
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
procstat input: Add Option to sum all matching processes #2480
Comments
What do you propose to do with fields that can't be summed? Such as |
telegraf is only showing "cpu_time_nice" for me. That should be summable though I think. It's a number of ticks if I'm reading gopsutils correctly. Resident set size is tricky and might not be super useful in this case - though perhaps just taking the max RSS might be okay? What would you suggest? It has been a while since I've dug into this sort of thing so I could be entirely wrong. |
@hobeone You should be able to do this now with the basicstats aggregator and careful use of the |
I'm curious if anyone can provide an example of this. I have this data:
Where I have 11 different gunicorn processes running on my machine at once, and I want to sum the total memory percentage gunicorn is taking up. So in this case, I have 11 processes x 3 10 second time intervals, for 33 points. I want to collapse that into 3 points by summing all of them for the same time value, grouping by process_name, regardless of tag. Tags are required for keeping the series separate (as they are the indexes), and the second I drop the pid tag, I lose the other series. The basicstats aggregator seems good for combining datapoints from multiple time windows across a single series, but I think this is multiple series. |
Feature Request
It would be useful to have the ability to sum the resource usage of all matching processes in the procstat input plugin. Currently if more than one process matches the (and you haven't set pid_tag = true from #1668 ) you will get only one of the processes information saved to influxdb since the tags are identical.
Adding pid_tag=true works around this at the cost of much higher resource usage in Influxdb which may be unnecessary if seeing a sum is what you want anyway.
The changes to the code doesn't seem that large and I'd be happy to make them but I wanted to see if this was something that would be accepted first.
Proposal:
[[inputs.procstat]]
pattern = "chrome"
sum_matches = true # invalid to set this with pid_tag = true
Current behavior:
One line per process matched
Desired behavior:
Sum the resource usage of all matched processes.
Use case:
For coarser grained monitoring getting the sum resource usage of a multiprocess/threaded daemon is sufficient.
The text was updated successfully, but these errors were encountered: