-
Notifications
You must be signed in to change notification settings - Fork 194
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
Create instant_per_process_cpu_mem_usage.sh #157
base: master
Are you sure you want to change the base?
Conversation
This file adds a quick wrapper around top. Most process CPU time collecting tools revolve around ps which does not provide instant cpu metrics, but % cpu spent since process was launched. Signed-off-by: Orsiris de Jong <[email protected]>
How does this compare to what process_exporter can do? |
process_exporter needs to be configured to pickup processes by names or groups, so you have to know beforehand which processes you want to monitor. This one just picks up whatever uses CPU or RAM. |
process_exporter matches process names by regular expression, which can be as concise or as vague as you like. The example in the README would match any process: process_names:
- name: "{{.Comm}}"
cmdline:
- '.+' Generally, a textfile collector should not overlap with functionality provided by promql. That includes Another thing that I would consider an absolute no-no is including process IDs as labels, since they are pretty much by definition high entropy, and would also result in similar problems as described above. The process_exporter README highlights that also:
|
I've actually played with process_exporter before trying to reinvent the wheel. On the good side of process_explorer:
Therefore the tool is not meant for the same job, this one is a "record my
What do you mean ? My script doesn't "aggregate" anything like
Makes sense. I'll have the PIDs removed, even if I still do think it makes sense at an admin's diagnostic level to know whether process |
Signed-off-by: Orsiris de Jong <[email protected]>
Signed-off-by: Orsiris de Jong <[email protected]>
Hello,
I've built this (very tiny footprint) script that allows to get non named per process CPU metrics.
Most other tools out there require to setup process group names in order to catch process metrics, other solutions provide with non instant cpu metrics given by
ps
.Getting instant per process cpu usage is really useful for admins to quickly find a culprit.
I did understand that you discourage shell scripts in favor of the Python client, but this one is mostly a big oneliner, and would only get a less tiny footprint if being rewritten in Python.
Would you mind merging this one ?
I've found no other solution out there to achieve the same, so I normally did not reinvent the wheel ;)
I can also provide the corresponding Grafana dashboard of course:
Hope this will help any other admins ;)
Best regards.