From a7e23e319264c5894c7917ff043bdfad5403ecba Mon Sep 17 00:00:00 2001 From: "Eric D. Schabell" Date: Thu, 3 Jul 2025 11:52:56 +0200 Subject: [PATCH] Adding YAML examples and standardizing shell usage. Fixes #1852. Signed-off-by: Eric D. Schabell --- pipeline/inputs/process.md | 64 +++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/pipeline/inputs/process.md b/pipeline/inputs/process.md index 06ba33913..1b3c62c34 100644 --- a/pipeline/inputs/process.md +++ b/pipeline/inputs/process.md @@ -1,10 +1,9 @@ # Process Metrics - - _Process_ input plugin allows you to check how healthy a process is. It does so by performing a service check at every certain interval of time specified by the user. The Process metrics plugin creates metrics that are log-based, such as JSON payload. -For Prometheus-based metrics, see the Node Exporter Metrics input plugin. + +For Prometheus-based metrics, see the [Node Exporter Metrics input plugin](node-exporter-metrics). ## Configuration Parameters @@ -26,15 +25,36 @@ In order to start performing the checks, you can run the plugin from the command The following example will check the health of _crond_ process. -```bash +```shell $ fluent-bit -i proc -p proc_name=crond -o stdout ``` ### Configuration File -In your main configuration file append the following _Input_ & _Output_ sections: +In your main configuration file append the following: + +{% tabs %} +{% tab title="fluent-bit.yaml" %} + +```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" %} -```python +```text [INPUT] Name proc Proc_Name crond @@ -48,21 +68,41 @@ In your main configuration file append the following _Input_ & _Output_ sections Match * ``` +{% endtab %} +{% endtabs %} + ## Testing Once Fluent Bit is running, you will see the health of process: -```bash +```shell $ fluent-bit -i proc -p proc_name=fluent-bit -o stdout -Fluent Bit v1.x.x -* Copyright (C) 2019-2020 The Fluent Bit Authors -* Copyright (C) 2015-2018 Treasure Data + +Fluent Bit v4.0.3 +* Copyright (C) 2015-2025 The Fluent Bit Authors * Fluent Bit is a CNCF sub-project under the umbrella of Fluentd * https://fluentbit.io -[2017/01/30 21:44:56] [ info] [engine] started +______ _ _ ______ _ _ ___ _____ +| ___| | | | | ___ (_) | / || _ | +| |_ | |_ _ ___ _ __ | |_ | |_/ /_| |_ __ __/ /| || |/' | +| _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / / /_| || /| | +| | | | |_| | __/ | | | |_ | |_/ / | |_ \ V /\___ |\ |_/ / +\_| |_|\__,_|\___|_| |_|\__| \____/|_|\__| \_/ |_(_)___/ + + +[2025/07/01 14:44:47] [ info] [fluent bit] version=4.0.3, commit=f5f5f3c17d, pid=1 +[2025/07/01 14:44:47] [ info] [storage] ver=1.5.3, type=memory, sync=normal, checksum=off, max_chunks_up=128 +[2025/07/01 14:44:47] [ info] [simd ] disabled +[2025/07/01 14:44:47] [ info] [cmetrics] version=1.0.3 +[2025/07/01 14:44:47] [ info] [ctraces ] version=0.6.6 +[2025/07/01 14:44:47] [ info] [input:mem:mem.0] initializing +[2025/07/01 14:44:47] [ info] [input:mem:mem.0] storage_strategy='memory' (memory only) +[2025/07/01 14:44:47] [ info] [sp] stream processor started +[2025/07/01 14:44:47] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2 +[2025/07/01 14:44:47] [ info] [output:stdout:stdout.0] worker #0 started [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}] -``` +``` \ No newline at end of file