Skip to content

[psutil] Only set psutil.PROCFS_PATH once in the collector#3013

Merged
olivielpeau merged 2 commits into
masterfrom
olivielpeau/fix-custom-procfs-path
Nov 11, 2016
Merged

[psutil] Only set psutil.PROCFS_PATH once in the collector#3013
olivielpeau merged 2 commits into
masterfrom
olivielpeau/fix-custom-procfs-path

Conversation

@olivielpeau

Copy link
Copy Markdown
Member

What does this PR do?

Fixes the procfs_path customization in the process check. Previously the procfs_path specified in process.yaml wouldn't be taken into account because psutil.PROCFS_PATH would get overwritten in the __init__ method of other checks (in particular the disk check since it runs by default)

Also, since PROCFS_PATH is a global setting of the psutil lib it makes sense to set it once for the whole collector and only allow its customization from datadog.conf, so let's deprecate the setting in process.yaml.

Additional Notes

🐮

@olivielpeau olivielpeau added this to the 5.10.1 milestone Nov 10, 2016
Since it's a global setting of `psutil` we should only set it once for
the whole collector.

To preserve backwards compatibility in the process check configuration
we only deprecate the setting in its `init_config` (instead of removing
it entirely), and use this setting when it doesn't conflict with what's
specified in `datadog.conf`.
@olivielpeau
olivielpeau force-pushed the olivielpeau/fix-custom-procfs-path branch from e531013 to d26a56c Compare November 10, 2016 04:56
Comment thread checks.d/process.py Outdated

if self._conflicting_procfs:
self.warning('The `procfs_path` defined in `process.yaml` is different from the one defined in '
'`datadog.conf`. This is currently not supported by the Agent')

@truthbk truthbk Nov 10, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably state here we're defaulting to the datadog.conf specified path. It's kind of implicit but if there's no more process logging it might seem like the check was partially skipped or whatever.

@olivielpeau
olivielpeau force-pushed the olivielpeau/fix-custom-procfs-path branch from 6f407e4 to 5cd709f Compare November 10, 2016 17:11
@olivielpeau
olivielpeau merged commit d342110 into master Nov 11, 2016
@olivielpeau
olivielpeau deleted the olivielpeau/fix-custom-procfs-path branch November 11, 2016 21:17
truthbk pushed a commit that referenced this pull request Nov 15, 2016
Since it's a global setting of `psutil` we should only set it once for
the whole collector.

To preserve backwards compatibility in the process check configuration
we only deprecate the setting in its `init_config` (instead of removing
it entirely), and use this setting when it doesn't conflict with what's
specified in `datadog.conf`.
degemer added a commit that referenced this pull request Nov 15, 2016
* master: (254 commits)
  Reduce the maximum amount of argument to pylint.
  [forwarder] stop flushing after 10s
  [etcd] Report errors connecting to etcd endpoint (#3007)
  Postfix check should pass raise_on_empty_output=False
  [status] Silence requests exception
  [psutil] Only set `psutil.PROCFS_PATH` once in the collector (#3013)
  [ci] fix check name detection of test files (#3021)
  [ci][rabbitmq] Increase wait timeout (#3022)
  [core] SpooledTemporaryFile for subprocess output (#3002)
  [collector] isolate system checks (#3001)
  [ci] Fix Travis jobs timing out (#3017)
  [mongo] Use db.current_op instead of manually querying (#3016)
  [ci] fix bad citizens detection (#3020)
  [ci] add debug logs (#3019)
  [mongo] use `currentOp` for mongodb 3.2+
  Use proxy for API key check in info page (#3012)
  [mongo] Add MongoDB 3.2 support
  [mongo] Add MongoDB 3.2 to travis-ci config
  [packaging] 5.11.0 nightlies (#3009)
  [core] hard-deprecate start/stop/restart/status (#3004)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants