2024-11-01 05:15:21 +08:00
|
|
|
# Control Group Input Plugin
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
This plugin gathers statistics per [control group (cgroup)][cgroup].
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
> [!NOTE]
|
|
|
|
|
> Consider restricting paths to the set of cgroups you are interested in if you
|
|
|
|
|
> have a large number of cgroups, to avoid cardinality issues.
|
2016-09-21 14:00:36 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
The plugin supports the _single value format_ in the form
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2021-11-25 02:55:55 +08:00
|
|
|
```text
|
2016-06-08 16:13:22 +08:00
|
|
|
VAL\n
|
|
|
|
|
```
|
|
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
the _new line separated values format_ in the form
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2021-11-25 02:55:55 +08:00
|
|
|
```text
|
2016-06-08 16:13:22 +08:00
|
|
|
VAL0\n
|
|
|
|
|
VAL1\n
|
|
|
|
|
```
|
|
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
the _space separated values format_ in the form
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2021-11-25 02:55:55 +08:00
|
|
|
```text
|
2016-06-08 16:13:22 +08:00
|
|
|
VAL0 VAL1 ...\n
|
|
|
|
|
```
|
|
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
and the _space separated keys and value, separated by new line format_ in the
|
|
|
|
|
form
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2021-11-25 02:55:55 +08:00
|
|
|
```text
|
2021-07-09 04:54:22 +08:00
|
|
|
KEY0 ... VAL0\n
|
|
|
|
|
KEY1 ... VAL1\n
|
2016-06-08 16:13:22 +08:00
|
|
|
```
|
|
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
⭐ Telegraf v1.0.0
|
|
|
|
|
🏷️ system
|
|
|
|
|
💻 linux
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
[cgroup]: https://docs.kernel.org/admin-guide/cgroup-v2.html
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
2023-01-12 23:55:21 +08:00
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
|
2022-10-27 03:58:36 +08:00
|
|
|
|
2021-11-25 02:55:55 +08:00
|
|
|
## Configuration
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2021-04-28 09:41:52 +08:00
|
|
|
# Read specific statistics per cgroup
|
2023-03-06 19:18:43 +08:00
|
|
|
# This plugin ONLY supports Linux
|
2022-04-08 06:01:21 +08:00
|
|
|
[[inputs.cgroup]]
|
2021-04-28 09:41:52 +08:00
|
|
|
## Directories in which to look for files, globs are supported.
|
|
|
|
|
## Consider restricting paths to the set of cgroups you really
|
|
|
|
|
## want to monitor if you have a large number of cgroups, to avoid
|
|
|
|
|
## any cardinality issues.
|
2016-06-08 16:13:22 +08:00
|
|
|
# paths = [
|
2021-04-28 09:41:52 +08:00
|
|
|
# "/sys/fs/cgroup/memory",
|
|
|
|
|
# "/sys/fs/cgroup/memory/child1",
|
|
|
|
|
# "/sys/fs/cgroup/memory/child2/*",
|
2016-06-08 16:13:22 +08:00
|
|
|
# ]
|
2021-04-28 09:41:52 +08:00
|
|
|
## cgroup stat fields, as file names, globs are supported.
|
|
|
|
|
## these file names are appended to each path from above.
|
2016-06-23 18:41:37 +08:00
|
|
|
# files = ["memory.*usage*", "memory.limit_in_bytes"]
|
2020-07-25 00:42:17 +08:00
|
|
|
```
|
2016-06-08 16:13:22 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
## Metrics
|
2020-07-25 00:42:17 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
All measurements have the `path` tag.
|
2023-02-09 18:04:41 +08:00
|
|
|
|
|
|
|
|
## Example Output
|