Skip to content

Commit c81d60f

Browse files
committed
Adding YAML examples and standardizing shell usage for Windows Exporter Metrics input plugin, part of issue #1859.
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent 51fb848 commit c81d60f

File tree

1 file changed

+59
-21
lines changed

1 file changed

+59
-21
lines changed

pipeline/inputs/windows-exporter-metrics.md

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ description: >-
66

77
# Windows Exporter Metrics
88

9-
[Prometheus Windows Exporter](https://github.com/prometheus-community/windows_exporter) is a popular way to collect system level metrics from microsoft windows, such as CPU / Disk / Network / Process statistics. Fluent Bit 1.9.0 includes windows exporter metrics plugin that builds off the Prometheus design to collect system level metrics without having to manage two separate processes or agents.
9+
[Prometheus Windows Exporter](https://github.com/prometheus-community/windows_exporter) is a popular way to collect system level metrics from microsoft windows, such as CPU / Disk / Network / Process statistics. Included since Fluent Bit 1.9.0, windows exporter metrics plugin builds off the Prometheus design to collect system level metrics without having to manage two separate processes or agents.
1010

11-
The initial release of Windows Exporter Metrics contains a single collector available from Prometheus Windows Exporter and we plan to expand it over time.
11+
The initial release of Windows Exporter Metrics contains a single collector available from Prometheus Windows Exporter.
12+
13+
{% hint style="warning" %}
1214

1315
**Important note:** Metrics collected with Windows Exporter Metrics flow through a separate pipeline from logs and current filters do not operate on top of metrics.
1416

17+
{% endhint %}
1518

1619
## Configuration
1720

@@ -73,7 +76,39 @@ This input always runs in its own [thread](../../administration/multithreading.m
7376

7477
In the following configuration file, the input plugin _windows_exporter_metrics collects _metrics every 2 seconds and exposes them through our [Prometheus Exporter](../outputs/prometheus-exporter.md) output plugin on HTTP/TCP port 2021.
7578

76-
```
79+
{% tabs %}
80+
{% tab title="fluent-bit.yaml" %}
81+
82+
```yaml
83+
# Node Exporter Metrics + Prometheus Exporter
84+
# -------------------------------------------
85+
# The following example collect host metrics on Linux and expose
86+
# them through a Prometheus HTTP end-point.
87+
#
88+
# After starting the service try it with:
89+
#
90+
# $ curl http://127.0.0.1:2021/metrics
91+
#
92+
service:
93+
flush: 1
94+
log_level: info
95+
96+
pipeline:
97+
inputs:
98+
- name: windows_exporter_metrics
99+
tag: node_metrics
100+
scrape_interval: 2
101+
102+
outputs:
103+
- name: prometheus_exporter
104+
match: node_metrics
105+
port: 2021
106+
```
107+
108+
{% endtab %}
109+
{% tab title="fluent-bit.conf" %}
110+
111+
```text
77112
# Node Exporter Metrics + Prometheus Exporter
78113
# -------------------------------------------
79114
# The following example collect host metrics on Linux and expose
@@ -97,14 +132,15 @@ In the following configuration file, the input plugin _windows_exporter_metrics
97132
match node_metrics
98133
host 0.0.0.0
99134
port 2021
100-
101-
102135
```
103136

137+
{% endtab %}
138+
{% endtabs %}
139+
104140
You can test the expose of the metrics by using _curl:_
105141

106-
```bash
107-
curl http://127.0.0.1:2021/metrics
142+
```shell
143+
$ curl http://127.0.0.1:2021/metrics
108144
```
109145

110146
### Service where clause
@@ -122,12 +158,13 @@ Here is how these parameters should work:
122158
`we.service.where` is handled as a raw WHERE clause.
123159
For example, when a user specifies the parameter as follows:
124160

125-
```
161+
```text
126162
we.service.where Status!='OK'
127163
```
128164

129165
This creates a WMI query like so:
130-
```
166+
167+
```sql
131168
SELECT * FROM Win32_Service WHERE Status!='OK'
132169
```
133170

@@ -140,18 +177,19 @@ If multiple key-value pairs are specified, the values will be concatenated with
140177
Also, if the values contain `%` character then a `LIKE` operator will be used in the clause instead of the `=` operator.
141178
When a user specifies the parameter as follows:
142179

143-
```python
180+
```text
144181
we.service.include {"Name":"docker","Name":"%Svc%", "Name":"%Service"}
145182
```
146183

147184
The parameter will be interpreted as:
148-
```
185+
186+
```text
149187
(Name='docker' OR Name LIKE '%Svc%' OR Name LIKE '%Service')
150188
```
151189

152190
The WMI query will be called with the translated parameter as:
153191

154-
```
192+
```sql
155193
SELECT * FROM Win32_Service WHERE (Name='docker' OR Name LIKE '%Svc%' OR Name LIKE '%Service')
156194
```
157195

@@ -163,18 +201,19 @@ If multiple key-value pairs are specified, the values will be concatenated with
163201
Also, if the values contain `%` character then a `LIKE` operator will be used in the translated clause instead of the `!=` operator.
164202
When a user specifies the parameter as follows:
165203

166-
```python
204+
```text
167205
we.service.exclude {"Name":"UdkUserSvc%","Name":"webthreatdefusersvc%","Name":"XboxNetApiSvc"}
168206
```
169207

170208
The parameter will be interpreted as:
171-
```
209+
210+
```sql
172211
(NOT Name LIKE 'UdkUserSvc%' AND NOT Name LIKE 'webthreatdefusersvc%' AND Name!='XboxNetApiSvc')
173212
```
174213

175214
The WMI query will be called with the translated parameter as:
176215

177-
```
216+
```sql
178217
SELECT * FROM Win32_Service WHERE (NOT Name LIKE 'UdkUserSvc%' AND NOT Name LIKE 'webthreatdefusersvc%' AND Name!='XboxNetApiSvc')
179218
```
180219

@@ -183,28 +222,27 @@ SELECT * FROM Win32_Service WHERE (NOT Name LIKE 'UdkUserSvc%' AND NOT Name LIKE
183222
`we.service.where`, `we.service.include`, and `we.service.exclude` can all be used at the same time subject to the following rules.
184223

185224
1. `we.service.include` translated and applied into the where clause in the service collector
186-
1. `we.service.exclude` translated and applied into the where clause in the service collector
225+
2. `we.service.exclude` translated and applied into the where clause in the service collector
187226
1. If the `we.service.include` is applied, translated `we.service.include` and `we.service.exclude` conditions are concatenated with `AND`.
188-
1. `we.service.where` is just handled as-is into the where clause in the service collector .
227+
3. `we.service.where` is just handled as-is into the where clause in the service collector .
189228
1. If either of the above parameters is applied, the clause will be applied with `AND (` _the value of `we.service.where`_ `)`.
190229

191230
For example, when a user specifies the parameter as follows:
192231

193-
```
232+
```text
194233
we.service.include {"Name":"docker","Name":"%Svc%", "Name":"%Service"}
195234
we.service.exclude {"Name":"UdkUserSvc%","Name":"XboxNetApiSvc"}
196235
we.service.where NOT Name LIKE 'webthreatdefusersvc%'
197236
```
198237

199238
The WMI query will be called with the translated parameter as:
200239

201-
```
240+
```sql
202241
SELECT * FROM Win32_Service WHERE (Name='docker' OR Name LIKE '%Svc%' OR Name LIKE '%Service') AND (NOT Name LIKE 'UdkUserSvc%' AND Name!='XboxNetApiSvc') AND (NOT Name LIKE 'webthreatdefusersvc%')
203242
```
204243

205-
206244
## Enhancement Requests
207245

208246
Our current plugin implements a sub-set of the available collectors in the original Prometheus Windows Exporter, if you would like that we prioritize a specific collector please open a Github issue by using the following template:\
209247
\
210-
\- [in_windows_exporter_metrics](https://github.com/fluent/fluent-bit/issues/new?assignees=\&labels=\&template=feature_request.md\&title=in_windows_exporter_metrics:%20add%20ABC%20collector)
248+
\- [in_windows_exporter_metrics](https://github.com/fluent/fluent-bit/issues/new?assignees=\&labels=\&template=feature_request.md\&title=in_windows_exporter_metrics:%20add%20ABC%20collector)

0 commit comments

Comments
 (0)