When we need memory related stats we add input plugin in telegraf.conf
file.
[[inputs.mem]]
- For application stats we keep input as statsd, we push stats from application using UDP to telegraf using its host and port.
[[inputs.statsd]]
Could someone explain how does [[inputs.mem]]
input plugins get data related to memory? Because no one is pushing data to telegraf in this case.
Telegraf retrieves system data using system libraries written for Go. At this time it is using the gopsutil library. This library's link above includes an example of how it could be used within any Go program.
This library supports a number of different operating systems and has modules for a variety of system information such as cpu, memory, disk, and networking usage. You can see where these are incorporated into the telegraf project here.