telegraf/plugins/inputs/procstat
Cameron Sparr 2eee1b84fb
break telegraf registry into separate package
this is for supporting external plugins.

external plugins will depend on a few telegraf interface types, as well
as a common telegraf registry.

this will allow external and internal plugins to both share this package
and make it easier to vendor/version the whole thing semantically, which
will make it easier to keep plugins supported across build and telegraf
versions.

see #1717
2017-02-06 11:16:29 +00:00
..
README.md Fix typo from 'Proctstas' to 'Procstat' in procstat plugin's README (#1945) 2016-10-25 13:57:55 +01:00
procstat.go break telegraf registry into separate package 2017-02-06 11:16:29 +00:00
procstat_test.go Procstat: don't cache PIDs (#2206) 2017-02-02 14:12:22 +00:00
spec_processor.go Procstat: don't cache PIDs (#2206) 2017-02-02 14:12:22 +00:00

README.md

Telegraf plugin: procstat

Description

The procstat plugin can be used to monitor system resource usage by an individual process using their /proc data.

The plugin will tag processes by their PID and their process name.

Processes can be specified either by pid file, by executable name, by command line pattern matching, or by username (in this order or priority. Procstat plugin will use pgrep when executable name is provided to obtain the pid. Procstat plugin will transmit IO, memory, cpu, file descriptor related measurements for every process specified. A prefix can be set to isolate individual process specific measurements.

Example:

[[inputs.procstat]]
  exe = "influxd"
  prefix = "influxd"

[[inputs.procstat]]
  pid_file = "/var/run/lxc/dnsmasq.pid"

The above configuration would result in output like:

> procstat,name="dnsmasq",pid="44979" cpu_user=0.14,cpu_system=0.07
> procstat,name="influxd",pid="34337" influxd_cpu_user=25.43,influxd_cpu_system=21.82

Measurements

Note: prefix can be set by the user, per process.

Threads related measurement names:

  • procstat_[prefix_]num_threads value=5

File descriptor related measurement names:

  • procstat_[prefix_]num_fds value=4

Context switch related measurement names:

  • procstat_[prefix_]voluntary_context_switches value=250
  • procstat_[prefix_]involuntary_context_switches value=0

I/O related measurement names:

  • procstat_[prefix_]read_count value=396
  • procstat_[prefix_]write_count value=1
  • procstat_[prefix_]read_bytes value=1019904
  • procstat_[prefix_]write_bytes value=1

CPU related measurement names:

  • procstat_[prefix_]cpu_user value=0
  • procstat_[prefix_]cpu_system value=0.01
  • procstat_[prefix_]cpu_idle value=0
  • procstat_[prefix_]cpu_nice value=0
  • procstat_[prefix_]cpu_iowait value=0
  • procstat_[prefix_]cpu_irq value=0
  • procstat_[prefix_]cpu_soft_irq value=0
  • procstat_[prefix_]cpu_soft_steal value=0
  • procstat_[prefix_]cpu_soft_stolen value=0
  • procstat_[prefix_]cpu_soft_guest value=0
  • procstat_[prefix_]cpu_soft_guest_nice value=0

Memory related measurement names:

  • procstat_[prefix_]memory_rss value=1777664
  • procstat_[prefix_]memory_vms value=24227840
  • procstat_[prefix_]memory_swap value=282624