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
Expose Swap/Paging usage per device #1115
Comments
if this is a change you are amenable to then we're willing to write a PR (at least for the OSs we care about) |
gopsutil is a port from psutil. psutil does not have such a device level swap usage. so, basically "No". To add, we should discuss about those.
For example, from my quick survey, FreeBSD can get device level swap usage by using swapctl like this
We need more information on Darwin to proceed discussion. For 2, create for example, |
I had a look around for a way to do this on Darwin and couldn't find one. It might not be possible. Are we able to proceed leaving Darwin as unimplemented, or this a showstopper? |
I've put together a PR for this. I did not manage to find a way to implement this for Darwin, but did find a way for Linux, FreeBSD, OpenBSD, Windows and Solaris. |
Is your feature request related to a problem? Please describe.
As part of OpenTelemetry collection, we would like to expose the swap usage per device. for more specifics on our use-case see: https://github.com/open-telemetry/opentelemetry-collector/issues/3447
Describe the solution you'd like
mem.VirtualMemory()
(or another method) to expose swap usage on a per device basis.Describe alternatives you've considered
Implementing this in the otel-collector instead. This is certainly possible, but we would prefer the logic be in gopsutil.
Additional context
Here is an example of collecting this in Linux: https://github.com/tbarker25/opentelemetry-collector/blob/swap-devices/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/pagefile_linux.go
The text was updated successfully, but these errors were encountered: