You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a `discard[]` URL parameter to discard specific enabled collectors.
Compared to `collect[]` parameter, the `discard[]` parameter results in a filtered list which equals enabled collectors minus discarded ones.
A small fix is applied to filtering related debug logs to print the actual slices instead of `unsupported value type`.
Signed-off-by: Siavash Safi <[email protected]>
The `node_exporter` will expose all metrics from enabled collectors by default. This is the recommended way to collect metrics to avoid errors when comparing metrics of different families.
341
341
342
-
For advanced use the `node_exporter` can be passed an optional list of collectors to filter metrics. The `collect[]` parameter may be used multiple times. In Prometheus configuration you can use this syntax under the [scrape config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#<scrape_config>).
342
+
For advanced use the `node_exporter` can be passed an optional list of collectors to filter metrics. The parameters `collect[]` and `discard[]` can be used multiple times (but cannot be combined). In Prometheus configuration you can use this syntax under the [scrape config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#<scrape_config>).
343
343
344
+
Collect only `cpu` and `meminfo` collector metrics:
344
345
```
345
346
params:
346
347
collect[]:
347
-
- foo
348
-
- bar
348
+
- cpu
349
+
- meminfo
350
+
```
351
+
352
+
Collect all enabled collector metrics but discard `netdev`:
353
+
```
354
+
params:
355
+
discard[]:
356
+
- netdev
349
357
```
350
358
351
359
This can be useful for having different Prometheus servers collect specific metrics from nodes.
0 commit comments