Skip to content
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

Exception in ProcessResource collector #667

Open
hvnsweeting opened this issue Jul 31, 2017 · 1 comment
Open

Exception in ProcessResource collector #667

hvnsweeting opened this issue Jul 31, 2017 · 1 comment

Comments

@hvnsweeting
Copy link
Contributor

I'm using latest version of diamond installed from pip

$ diamond --version
Diamond version 4.0.515

Got exception

1501479599.29	[ProcessResourcesCollector:20455:ERROR]	/tmp/py2/local/lib/python2.7/site-packages/diamond/utils/scheduler.py:99
Traceback (most recent call last):
  File "/tmp/py2/local/lib/python2.7/site-packages/diamond/utils/scheduler.py", line 73, in collector_process
    collector._run()
  File "/tmp/py2/local/lib/python2.7/site-packages/diamond/collector.py", line 477, in _run
    self.collect()
  File "/tmp/py2/share/diamond/collectors/processresources/processresources.py", line 198, in collect
    self.collect_process_info(process)
  File "/tmp/py2/share/diamond/collectors/processresources/processresources.py", line 178, in collect_process_info
    pi = process_info(process, self.config['info_keys'])
  File "/tmp/py2/share/diamond/collectors/processresources/processresources.py", line 78, in process_info
    process_info = process.as_dict(info_keys)
  File "/tmp/py2/local/lib/python2.7/site-packages/psutil/__init__.py", line 552, in as_dict
    ", ".join(map(repr, invalid_names))))
ValueError: invalid attr name 'memory_info_ex'

Seem caused by new version of psutil removed the memory_info_ex

>>> psutil.version_info
(5, 2, 2)
>>> psutil.Process().as_dict().keys()
['status', 'cpu_num', 'num_ctx_switches', 'pid', 'memory_full_info', 'connections', 'cmdline', 'create_time', 'ionice', 'num_fds', 'memory_maps', 'cpu_percent', 'terminal', 'ppid', 'cwd', 'nice', 'username', 'cpu_times', 'io_counters', 'memory_info', 'threads', 'open_files', 'name', 'num_threads', 'exe', 'uids', 'gids', 'cpu_affinity', 'memory_percent', 'environ']

The memory_info_ex introduced in 4b8b13f#diff-06a2be2c3ff6b70d9d12032be5653241R14

For now, to workaround, I just remove memory_info_ex from info_keys config of the collector.

@shortdudey123
Copy link
Member

Feel free to submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants