-
Notifications
You must be signed in to change notification settings - Fork 813
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
dd-agent fails to get gunicorn process on linux #706
Comments
Thanks for reporting. Two questions:
|
The line returned by f.read() looks like this: |
Sure, this is ps | aux root 13979 0.0 3.8 79644 23232 ? Ss 16:38 0:00 gunicorn: master [PROCESS_NAME] Configuring the proc name as of that example won't help, since it will only change the value of PROCESS_NAME, which isn't shown by psutil |
import psutil
[p.name for p in psutil.process_iter() if p.name == 'gunicorn:']
['gunicorn:', 'gunicorn:', 'gunicorn:', 'gunicorn:'] |
p.cmldine returns ['gunicorn: master [PROCESS_NAME]'] which is what dd-agent is looking for |
Changing [1]: master_procs = [p for p in psutil.process_iter() if p.name == master_name] For: master_procs = [p for p in psutil.process_iter() if p.cmdline and p.cmdline[0] == master_name] Fixed the issue for me. |
Ok great. Thank for digging into that. We'll include it in our next release. |
Thanks @nxvl ! |
For the posteriors, I was having trouble getting these to work and realized I didn't have the necessary |
|
dd-agent try to gets unicorn master process by name using this line [1]:
However, psutil trims the process name removing spaces, in this line [2]:
which return "gunicorn:" as process name, generating the following error:
The text was updated successfully, but these errors were encountered: