Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Does the telegraf plugin procstat not monitor swap usage?

So, looking at the procstat and gopsutil source codes I found this:

The memory_swap metric gets set here:

https://github.com/influxdata/telegraf/blob/master/plugins/inputs/procstat/procstat.go#L221

right after memory data is retrieved from gopsutil here:

https://github.com/influxdata/telegraf/blob/master/plugins/inputs/procstat/procstat.go#L217

which calls this:

https://github.com/shirou/gopsutil/blob/master/process/process_linux.go#L456

wich calls this:

https://github.com/shirou/gopsutil/blob/master/process/process_linux.go#L460

which gets its data from here:

https://github.com/shirou/gopsutil/blob/master/process/process_linux.go#L921

which gets it from here:

https://github.com/shirou/gopsutil/blob/master/process/process_linux.go#L925

which returns the relevant MemoryInfoStat data structure created here:

https://github.com/shirou/gopsutil/blob/master/process/process_linux.go#L942

after which point it is retrurned along the call stack without being modified any further.

The created data structure gets two of its fields set, and the rest get defaulted to zero. One of these fields, is the Swap field.

So, my question is, does the swap usage get completely ignored by telegraf/procstat?

Comments