Skip to content

Commit ae9f7f5

Browse files
authored
Adding YAML examples and shell standardization to process exporter metrics input plugin docs. Fixes #1847. (#1850)
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent a9f113a commit ae9f7f5

File tree

1 file changed

+53
-16
lines changed

1 file changed

+53
-16
lines changed

pipeline/inputs/process-exporter-metrics.md

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Fluent Bit 2.2 and later includes a process exporter plugin that builds off the
1212
The Process Exporter Metrics plugin implements collecting of the various metrics available from [the third party implementation of Prometheus Process Exporter](https://github.com/ncabatoff/process-exporter) and these will be expanded over time as needed.
1313

1414
{% hint style="info" %}
15-
All metrics including those collected with this plugin flow through a separate pipeline from logs and current filters don't operate on top of metrics.
16-
{% endhint %}
1715

18-
This plugin is only supported on Linux based operating systems as it uses the `proc` filesystem to access the relevant metrics.
16+
All metrics including those collected with this plugin flow through a separate pipeline from logs and current filters don't
17+
operate on top of metrics. This plugin is only supported on Linux based operating systems as it uses the `proc` filesystem to
18+
access the relevant metrics. MacOS doesn't have the `proc` filesystem so this plugin won't work for it.
1919

20-
macOS doesn't have the `proc` filesystem so this plugin won't work for it.
20+
{% endhint %}
2121

2222
## Configuration
2323

@@ -53,7 +53,40 @@ This input always runs in its own [thread](../../administration/multithreading.m
5353

5454
In the following configuration file, the input plugin `process_exporter_metrics` collects metrics every 2 seconds and exposes them through the [Prometheus Exporter](../outputs/prometheus-exporter.md) output plugin on HTTP/TCP port 2021.
5555

56-
```python
56+
{% tabs %}
57+
{% tab title="fluent-bit.yaml" %}
58+
59+
```yaml
60+
# Process Exporter Metrics + Prometheus Exporter
61+
# -------------------------------------------
62+
# The following example collect host metrics on Linux and expose
63+
# them through a Prometheus HTTP end-point.
64+
#
65+
# After starting the service try it with:
66+
#
67+
# $ curl http://127.0.0.1:2021/metrics
68+
#
69+
service:
70+
flush: 1
71+
log_level: info
72+
73+
pipeline:
74+
inputs:
75+
- name: process_exporter_metrics
76+
tag: process_metrics
77+
scrape_interval: 2
78+
79+
outputs:
80+
- name: prometheus_exporter
81+
match: process_metrics
82+
host: 0.0.0.0
83+
port: 2021
84+
```
85+
86+
{% endtab %}
87+
{% tab title="fluent-bit.conf" %}
88+
89+
```text
5790
# Process Exporter Metrics + Prometheus Exporter
5891
# -------------------------------------------
5992
# The following example collect host metrics on Linux and expose
@@ -79,10 +112,13 @@ In the following configuration file, the input plugin `process_exporter_metrics`
79112
port 2021
80113
```
81114

115+
{% endtab %}
116+
{% endtabs %}
117+
82118
You can see the metrics by using `curl`:
83119

84-
```bash
85-
curl http://127.0.0.1:2021/metrics
120+
```shell
121+
$ curl http://127.0.0.1:2021/metrics
86122
```
87123

88124
### Container to collect host metrics
@@ -93,18 +129,19 @@ The following `docker` command deploys Fluent Bit with a specific mount path for
93129
`procfs` and settings enabled to ensure that Fluent Bit can collect from the host.
94130
These are then exposed over port 2021.
95131

96-
```bash
97-
docker run -ti -v /proc:/host/proc:ro \
98-
-p 2021:2021 \
99-
fluent/fluent-bit:2.2 \
100-
/fluent-bit/bin/fluent-bit \
101-
-i process_exporter_metrics -p path.procfs=/host/proc \
102-
-o prometheus_exporter \
103-
-f 1
132+
```shell
133+
$ docker run -ti -v /proc:/host/proc:ro \
134+
-p 2021:2021 \
135+
fluent/fluent-bit:2.2 \
136+
/fluent-bit/bin/fluent-bit \
137+
-i process_exporter_metrics \
138+
-p path.procfs=/host/proc \
139+
-o prometheus_exporter \
140+
-f 1
104141
```
105142

106143
## Enhancement requests
107144

108145
Development prioritises a subset of the available collectors in the [third party implementation of Prometheus Process Exporter](https://github.com/ncabatoff/process-exporter). To request others, open a GitHub issue by using the following template:
109146

110-
- [`in_process_exporter_metrics`](https://github.com/fluent/fluent-bit/issues/new?assignees=\&labels=\&template=feature_request.md\&title=in_process_exporter_metrics:%20add%20ABC%20collector)
147+
- [`in_process_exporter_metrics`](https://github.com/fluent/fluent-bit/issues/new?assignees=\&labels=\&template=feature_request.md\&title=in_process_exporter_metrics:%20add%20ABC%20collector)

0 commit comments

Comments
 (0)