{% hint style="info" %}
Supported event types: logs
{% endhint %}
The Process metrics input plugin lets you check how healthy a process is. It does so by performing service checks at specified intervals.
This plugin creates metrics that are log-based, such as JSON payloads. For Prometheus-based metrics, see the Node exporter metrics input plugin.
The plugin supports the following configuration parameters:
| Key | Description | Default |
|---|---|---|
alert |
If enabled, the plugin will only generate messages if the target process is down. | false |
fd |
If enabled, a number of fd is appended to each record. |
true |
interval_nsec |
Specifies the interval between service checks, in nanoseconds. This works in conjunction with interval_sec. |
0 |
interval_sec |
Specifies the interval between service checks, in seconds. | 1 |
mem |
If enabled, memory usage of the process is appended to each record. | true |
proc_name |
The name of the target process to check. | none |
threaded |
Specifies whether to run this input in its own thread. | false |
To start performing the checks, you can run the plugin from the command line or through the configuration file:
The following example checks the health of crond process.
fluent-bit -i proc -p proc_name=crond -o stdoutIn your main configuration file, append the following sections:
{% tabs %} {% tab title="fluent-bit.yaml" %}
pipeline:
inputs:
- name: proc
proc_name: crond
interval_sec: 1
interval_nsec: 0
fd: true
mem: true
outputs:
- name: stdout
match: '*'{% endtab %} {% tab title="fluent-bit.conf" %}
[INPUT]
Name proc
Proc_Name crond
Interval_Sec 1
Interval_Nsec 0
Fd true
Mem true
[OUTPUT]
Name stdout
Match *
{% endtab %} {% endtabs %}
After Fluent Bit starts running, it outputs the health of the process:
$ fluent-bit -i proc -p proc_name=fluent-bit -o stdout
...
[0] proc.0: [1485780297, {"alive"=>true, "proc_name"=>"fluent-bit", "pid"=>10964, "mem.VmPeak"=>14740000, "mem.VmSize"=>14740000, "mem.VmLck"=>0, "mem.VmHWM"=>1120000, "mem.VmRSS"=>1120000, "mem.VmData"=>2276000, "mem.VmStk"=>88000, "mem.VmExe"=>1768000, "mem.VmLib"=>2328000, "mem.VmPTE"=>68000, "mem.VmSwap"=>0, "fd"=>18}]
[1] proc.0: [1485780298, {"alive"=>true, "proc_name"=>"fluent-bit", "pid"=>10964, "mem.VmPeak"=>14740000, "mem.VmSize"=>14740000, "mem.VmLck"=>0, "mem.VmHWM"=>1148000, "mem.VmRSS"=>1148000, "mem.VmData"=>2276000, "mem.VmStk"=>88000, "mem.VmExe"=>1768000, "mem.VmLib"=>2328000, "mem.VmPTE"=>68000, "mem.VmSwap"=>0, "fd"=>18}]
[2] proc.0: [1485780299, {"alive"=>true, "proc_name"=>"fluent-bit", "pid"=>10964, "mem.VmPeak"=>14740000, "mem.VmSize"=>14740000, "mem.VmLck"=>0, "mem.VmHWM"=>1152000, "mem.VmRSS"=>1148000, "mem.VmData"=>2276000, "mem.VmStk"=>88000, "mem.VmExe"=>1768000, "mem.VmLib"=>2328000, "mem.VmPTE"=>68000, "mem.VmSwap"=>0, "fd"=>18}]
[3] proc.0: [1485780300, {"alive"=>true, "proc_name"=>"fluent-bit", "pid"=>10964, "mem.VmPeak"=>14740000, "mem.VmSize"=>14740000, "mem.VmLck"=>0, "mem.VmHWM"=>1152000, "mem.VmRSS"=>1148000, "mem.VmData"=>2276000, "mem.VmStk"=>88000, "mem.VmExe"=>1768000, "mem.VmLib"=>2328000, "mem.VmPTE"=>68000, "mem.VmSwap"=>0, "fd"=>18}]
...