process

Reference for the `process` collector.

process · collector · run nanook doc process for the same content in your terminal.

Status, CPU, and memory usage for a specific process.

Options

OptionTypeDefaultDescription
pidstring—process ID to monitor (one of pid or name is required)
namestring—substring matched against process name (one of pid or name is required)

Metrics

MetricKindUnitDescription
process.statusbool—true if the process is running. Labels: pid, process.
process.stateenum—process state label. Labels: pid, process.
process.cpunumeric%CPU usage percentage. Labels: pid, process.
process.memnumericbytesresident memory in bytes. Labels: pid, process.

Examples

Watchdog for nginx

[[collectors]]
name = "nginx"
kind = "process"
interval = 10
[collectors.opts]
name = "nginx"

Process gone

[[alerts]]
expr = 'nginx::process.status is "false"'
count = 1
channel = "ops"
escalate = { after = 120, channel = "oncall" }

Memory bloat in a worker

[[collectors]]
name = "worker"
kind = "process"
interval = 30
[collectors.opts]
name = "myapp-worker"

[[alerts]]
expr = "worker::process.mem > 1GiB"
count = 3
channel = "ops"
body = "{{ labels.process }} pid {{ labels.pid }} using {{ value }}"