telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

[procstat] why keep these meaningless fields

Open Karmenzind opened this issue 3 years ago • 1 comments

image

  1. Left side is the code of procstat and the right side is where these fields are from. Why keep these empty values?
  2. What's the meaning of cpu_time_idle for a single process?

image

This struct TimesStat is defined in "cpu.go". Obviously some fields like Idle and Irq are only for CPU context. But procstat plugin took them all. It's really confusing.

Karmenzind avatar Sep 06 '22 10:09 Karmenzind

You are definitely right, they are kept because of backward compatibility or it has not come to attention they are always empty.

You can choose to drop these fields by doing fielddrop on the input config.

You can also create a PR that removes these useless fields, it can then internally be discussed if this is accepted now or for upcoming 2.0 release.

Hipska avatar Sep 19 '22 10:09 Hipska