Process check

Overview

  • Capture metrics from specific running processes on a system such as CPU %, memory, and I/O.

Setup

Installation

No installation required.

Configuration

Configure the Agent to connect to your processes. Our example configuration will monitor the ssh, sshd, and postgres processes.

  1. Edit /etc/sts-agent/conf.d/process.yaml

    init_config:
      # used to override the default procfs path, e.g. for docker
      # containers to see the processes of the host at /host/proc
      # procfs_path: /proc
    instances:
      - name: ssh
        search_string: ['ssh', 'sshd']
    
      - name: postgres
        search_string: ['postgres']
    
      - name: pid_process
        pid: 1278
        # Do not use search_string when searching by pid or multiple processes will be grabbed
    
  2. Restart the Agent

    sudo /etc/init.d/stackstate-agent restart
    

Refer to the comments in the process.yaml.example file for more options.

Validation

  1. Execute the info command

    sudo /etc/init.d/stackstate-agent info
    
  2. Verify that the check has passed. The output of the command should contain a section similar to the following:

    Checks
    ======
    
    [...]
    
    process
    ---------
        - instance #0 [OK]
        - Collected 18 metrics & 0 events & 2 service checks
    

Each instance, regardless of the number of search strings used, counts for a single instance in the info command output.

Data Collected

Metrics

Visit the Metrics Explorer to see the new metrics available. You will find all the metrics under system.processes.

system.processes.cpu.pct
(gauge)
The process CPU utilization.
shown as percent
system.processes.involuntary_ctx_switches
(gauge)
The number of involuntary context switches performed by this process.
shown as event
system.processes.ioread_bytes
(gauge)
The number of bytes read from disk by this process.
shown as byte
system.processes.ioread_count
(gauge)
The number of disk reads by this process.
shown as read
system.processes.iowrite_bytes
(gauge)
The number of bytes written to disk by this process.
shown as byte
system.processes.iowrite_count
(gauge)
The number of disk writes by this process.
shown as write
system.processes.mem.page_faults.minor_faults
(gauge)
The number of minor page faults per second for this process.
shown as occurrence
system.processes.mem.page_faults.children_minor_faults
(gauge)
The number of minor page faults per second for children of this process.
shown as occurrence
system.processes.mem.page_faults.major_faults
(gauge)
The number of major page faults per second for this process.
shown as occurrence
system.processes.mem.page_faults.children_major_faults
(gauge)
The number of major page faults per second for children of this process.
shown as occurrence
system.processes.mem.pct
(gauge)
The process memory consumption.
shown as percent
system.processes.mem.real
(gauge)
The non-swapped physical memory a process has used and cannot be shared with another process.
shown as byte
system.processes.mem.rss
(gauge)
The non-swapped physical memory a process has used. aka "Resident Set Size".
shown as byte
system.processes.mem.vms
(gauge)
The total amount of virtual memory used by the process. aka "Virtual Memory Size".
shown as byte
system.processes.number
(gauge)
The number of processes.
shown as process
system.processes.open_file_descriptors
(gauge)
The number of file descriptors used by this process.
shown as
system.processes.open_handles
(gauge)
The number of handles used by this process.
shown as
system.processes.threads
(gauge)
The number of threads used by this process.
shown as thread
system.processes.voluntary_ctx_switches
(gauge)
The number of voluntary context switches performed by this process.
shown as event
system.processes.run_time.avg
(gauge)
The average running time of all instances of this process
shown as second
system.processes.run_time.max
(gauge)
The longest running time of all instances of this process
shown as second
system.processes.run_time.min
(gauge)
The shortest running time of all instances of this process
shown as second