Coder Social home page Coder Social logo

chair300 / snap-plugin-collector-procchild Goto Github PK

View Code? Open in Web Editor NEW

This project forked from staples-inc/snap-plugin-collector-procstat

0.0 2.0 0.0 3.46 MB

Collect process metrics using the snap telemetry framework

License: Apache License 2.0

Makefile 0.71% Go 97.19% Shell 2.09%

snap-plugin-collector-procchild's Introduction

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:

  • Linux/amd64

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
  }
}
  • Specify the pid file with the desired name identifier using the format: "files": "<filepath>:<name>,<filepath>:<name>,..."
  • Ensure your snap agent is run with the correct permissions to collect from the /proc/<pid>/ file

Roadmap

  • Add pgrep functionality for tracking a process in addition to files.
"config": {
  "/staples/procfs/procstat":{
    "files":"/tmp/snap.pid:coolio,/tmp/syslog.pid",
    "pgrep":"mongo,java:cassandra"
  }
}
  • Allow for pid interface to manage multiple pids if a file contains more than one or if pgrep returns more than one

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

snap-plugin-collector-procchild's People

Contributors

chair300 avatar jtlisi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.