Skip to content

Commit 0e0eccf

Browse files
authored
Fixing shel usage and standardizing on YAML examples for node exporter metrics input plugin. Fixes #1831. (#1832)
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent d3fe6e0 commit 0e0eccf

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

pipeline/inputs/node-exporter-metrics.md

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ description: A plugin based on Prometheus Node Exporter to collect system and ho
99
The _Node exporter metrics_ plugin contains a subset of collectors and metrics available from Prometheus Node exporter.
1010

1111
{% hint style="info" %}
12-
Metrics collected with Node Exporter Metrics flow through a separate pipeline from logs and current filters don't operate on top of metrics.
13-
{% endhint %}
1412

13+
Metrics collected with Node Exporter Metrics flow through a separate pipeline from logs and current filters don't operate on top of metrics.
1514
This plugin is generally supported on Linux-based operating systems, with macOS offering a reduced subset of metrics.
1615

16+
{% endhint %}
17+
1718
## Configuration
1819

1920
`scrape_interval` sets the default for all scrapes. To set granular scrape intervals, set the specific interval. For example, `collector.cpu.scrape_interval`. When using a granular scrape interval, if a value greater than `0` is used, it overrides the global default. Otherwise the global default is used.
@@ -108,11 +109,13 @@ In the following configuration file, the input plugin `node_exporter_metrics` co
108109
service:
109110
flush: 1
110111
log_level: info
112+
111113
pipeline:
112114
inputs:
113115
- name: node_exporter_metrics
114116
tag: node_metrics
115117
scrape_interval: 2
118+
116119
outputs:
117120
- name: prometheus_exporter
118121
match: node_metrics
@@ -123,7 +126,7 @@ pipeline:
123126
{% endtab %}
124127
{% tab title="fluent-bit.conf" %}
125128
126-
```python
129+
```text
127130

128131
# Node Exporter Metrics + Prometheus Exporter
129132
# -------------------------------------------
@@ -157,23 +160,26 @@ pipeline:
157160

158161
You can test the expose of the metrics by using `curl`:
159162

160-
```bash
161-
curl http://127.0.0.1:2021/metrics
163+
```shell
164+
$ curl http://127.0.0.1:2021/metrics
162165
```
163166

164167
### Container to collect host metrics
165168

166169
When deploying Fluent Bit in a container you will need to specify additional settings to ensure that Fluent Bit has access to the host operating system. The following Docker command deploys Fluent Bit with specific mount paths and settings enabled to ensure that Fluent Bit can collect from the host. These are then exposed over port `2021`.
167170

168171
```shell
169-
docker run -ti -v /proc:/host/proc \
170-
-v /sys:/host/sys \
171-
-p 2021:2021 \
172-
fluent/fluent-bit:1.8.0 \
173-
/fluent-bit/bin/fluent-bit \
174-
-i node_exporter_metrics -p path.procfs=/host/proc -p path.sysfs=/host/sys \
175-
-o prometheus_exporter -p "add_label=host $HOSTNAME" \
176-
-f 1
172+
$ docker run -ti -v /proc:/host/proc \
173+
-v /sys:/host/sys \
174+
-p 2021:2021 \
175+
fluent/fluent-bit:1.8.0 \
176+
/fluent-bit/bin/fluent-bit \
177+
-i node_exporter_metrics \
178+
-p path.procfs=/host/proc \
179+
-p path.sysfs=/host/sys \
180+
-o prometheus_exporter \
181+
-p "add_label=host $HOSTNAME" \
182+
-f 1
177183
```
178184

179185
### Fluent Bit with Prometheus and Grafana
@@ -182,19 +188,21 @@ If you use dashboards for monitoring, Grafana is one option. The Fluent Bit sour
182188

183189
1. Download the Fluent Bit source code:
184190

185-
```bash
186-
git clone https://github.com/fluent/fluent-bit
187-
cd fluent-bit/docker_compose/node-exporter-dashboard/
191+
```shell
192+
$ git clone https://github.com/fluent/fluent-bit
193+
194+
$ cd fluent-bit/docker_compose/node-exporter-dashboard/
188195
```
189196

190-
1. Start the service and view your dashboard:
197+
2. Start the service and view your dashboard:
191198

192-
```bash
193-
docker-compose up --force-recreate -d --build
199+
```shell
200+
$ docker-compose up --force-recreate -d --build
194201
```
195202

196-
1. Open your browser and use the address `http://127.0.0.1:3000`.
197-
1. When asked for the credentials to access Grafana, use `admin` for the username and
203+
3. Open your browser and use the address `http://127.0.0.1:3000`.
204+
205+
4. When asked for the credentials to access Grafana, use `admin` for the username and
198206
password. See [Sign in to Grafana](https://grafana.com/docs/grafana/latest/setup-grafana/sign-in-to-grafana/).
199207

200208
![An example Grafana dashboard](../../.gitbook/assets/updated.png)
@@ -203,12 +211,12 @@ By default, Grafana dashboard plots the data from the last 24 hours. Change it t
203211

204212
#### Stop the Service
205213

206-
```bash
207-
docker-compose down
214+
```shell
215+
$ docker-compose down
208216
```
209217

210218
## Enhancement requests
211219

212220
The plugin implements a subset of the available collectors in the original Prometheus Node exporter. If you would like a specific collector prioritized, open a GitHub issue by using the following template:
213221

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

0 commit comments

Comments
 (0)