-
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
get full process path via procstat as TAG #1873
Comments
👍 I think, the actual procstat plugin has several more issues:
|
@zbindenren, actually p.2 can be changed by using pid_tag=true. Regarding p.1, this should be quite easy? Not really familiar with Go and library used, but Cmdline should be the thing we need: |
+1 for this as well. Our use case is monitoring the qemu processes of Openstack's KVM hypervisors. In our case the instances' names are the filename in /var/run/libvirt/qemu/*.pid but because you cannot glob the pid_name directive in the telegraf procstat conf it is useless. In lieu of that, we currently use the pattern='qemu-system' but as mentioned the only identifier is then the pid which is useless! |
I'm not convinced that adding the cmdline is the right decision. Often, the full command lines is very long, other times there are dynamic values in the cmdline, here is an example of both that I happen to have running on my laptop right now:
|
Agreed it could be an issue but I havent got a completely suitable solution atm. One idea would be to capture a regex of the full cmdline. ie for the above full_cmdline_regex = ".-nameguest=(.),.*" which would essentially capture 'debian-stretch-tomcat'. If multiple capture groups are defined, concat using a comma. This and the original command /usr/bin/qemu-system-x86_64 would be sufficient context at least in my use case. I assume individuals running java cmds for instance could similarly grep out the jar file and instance id, ports etc Will have a think about it further though... |
Since 1.7, it would be possible to use the regex processor to tidy up cmdline values. At some point I want to allow processors to be directly attached to inputs as well, but that's another idea. What if we added an option like this to allow limiting the number of args added to the tag:
If the default is 0, it will be opt-in and no one will be slammed with long tag values. |
I would prefer the regexp suggestion above because I bet there are enough examples where just get a specific amount of arguments from the beginning would not fit any wanted use-case. |
Correct me if I am wrong but output of the cmdline/path to the executable (in my case especially Windows) has not yet been added? I am in dire need to differentiate my processes somehow since I have about 10 instances of the same .exe which can only be differentiated by their path. If there is another input plugin that is capable of this I would also be willing to switch (but would rather stick with procstat). |
Would love to see this feature, thanks for anyone who is continuing to look into it. |
System info:
[Include Telegraf version, operating system name, and other relevant details]
telegraf-1.0.0-1.x86_64
RHEL6
Feature Request
include command_line as a field collected from procstat .
Proposal:
get the full command line from /proc/*/cmdline . return the contents of this file as a tag.
Current behavior:
returns only the short name for the process and pid as the identifier of the process.
Desired behavior:
list the full process path as tag so that you may identify which process is which
Use case: [Why is this important (helps with prioritizing requests)]
for example you run a java application, procstat current captures "java" as the process name. This is fine if your run one of something but it very common in enterprise architecture to run multiples of something with different configs file/arguments . Capturing only java make it impossible (or very hard) to differentiate between them for resource usage.
The text was updated successfully, but these errors were encountered: