Staples-Inc / snap-plugin-collector-procstat

Collect process metrics using the snap telemetry framework
Apache License 2.0
4 stars 2 forks source link

snap collector plugin - procstat

The procstat collector takes a specified pid file and collects metrics from the process specified by that pid file.

Build Status

Getting Started

System Requirements

Operating systems

All OSs currently supported by plugin:

Build

Build the plugin by running make within the repo:

$ make

This builds the plugin in /build/rootfs/

Run

The configuration for the procstat plugin is in the task file. The pids designated for collection must exist in a pid file.

"workflow": {
  "collect": {
    "metrics": {
      "/staples/procfs/procstat/*/cpu_time_system": {},
      "/staples/procfs/procstat/*/cpu_time_user": {},
      "/staples/procfs/procstat/*/cpu_usage": {},
      "/staples/procfs/procstat/*/fds": {},
      "/staples/procfs/procstat/*/involuntary_context_switches": {},
      "/staples/procfs/procstat/*/memory_rss": {},
      "/staples/procfs/procstat/*/memory_swap": {},
      "/staples/procfs/procstat/*/memory_vms": {},
      "/staples/procfs/procstat/*/numThreads": {},
      "/staples/procfs/procstat/*/process_uptime": {},
      "/staples/procfs/procstat/*/read_bytes": {},
      "/staples/procfs/procstat/*/read_count": {},
      "/staples/procfs/procstat/*/voluntary_context_switches": {},
      "/staples/procfs/procstat/*/write_bytes": {},
      "/staples/procfs/procstat/*/write_count": {}
    },
    "config": {
      "/staples/procfs/procstat":{
        "files":"/tmp/snap.pid:coolio,/tmp/syslog.pid"
      }
    },
    "publish": null
  }
}

Roadmap

If you have suggestions please open up an issue or provide a pull request.