-
Notifications
You must be signed in to change notification settings - Fork 814
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
[psutil] Upgrade to 4.4.1 #2957
Conversation
Previously, psutil didn't take into account root reserved space to compute the `disk.in_use` percentage. PR#1784 implemented a workaround on the disk check so that it would send values that are consistent with `df`'s output. psutil v4.3.0 fixed this issue. Now that we're using psutil 4.4.1, let's revert our workaround. Reference: https://github.com/giampaolo/psutil/blob/master/HISTORY.rst#430
Allows to get rid of WMI in the cpu check. `interrupt` has been added to psutil 4.1.0
1dceba0
to
5d56ed3
Compare
- remove mock of `open` (useless since psutil upgrade) - add `Threads` to mocked `status` file (otherwise psutil crashes), and test related metric
5d56ed3
to
8bc67cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good beside the open question
self.counter('system.cpu.system') | ||
self.counter('system.cpu.interrupt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ?
is that a breaking change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically an old-style-check counter
s is the equivalent of a rate
s of a new-style check. It's still stored as a gauge in the backend, so there's no backwards-compatibility issue.
We compute a rate
here because psutil.cpu_times
returns for interrupt
the same kind of value as for the other cpu values, i.e. the total time the cpu(s) spent in the interrupt state since startup, so to get a percentage from this we need to compute the rate divided by the number of cpus and multiply that by 100.
What does this PR do?
Upgrades psutil to the latest version (
4.4.1
), and related changes ondd-agent
(see details in commit messages):in_use
percentage provided by psutilpsutil
to samplecpu.interrupt
: tested on my local windows VM:psutil
andWMI
send the same values forcpu.interrupt
Motivation
The upgrade was requested by a customer so that we ship a version that includes this fix: giampaolo/psutil#761
More generally it's good to keep an up-to-date version.
Testing Guidelines
Went through the changelog of
psutil
and through the occurences ofpsutil
indd-agent
to find things that could be affected. Not sure I've spotted everything but I'll closely monitor the deploy of the updated Agent on our staging infrastructure (especially for thegunicorn
check that could potentially be affected).Additional Notes
Related PR on
omnibus-software
: DataDog/omnibus-software#82psutil
changelog: https://github.com/giampaolo/psutil/blob/master/HISTORY.rst