telegraf/plugins/inputs/cgroup/README.md

77 lines
1.6 KiB
Markdown
Raw Normal View History

# CGroup Input Plugin
2016-06-08 16:13:22 +08:00
This input plugin will capture specific statistics per cgroup.
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
Following file formats are supported:
* Single value
```text
2016-06-08 16:13:22 +08:00
VAL\n
```
* New line separated values
```text
2016-06-08 16:13:22 +08:00
VAL0\n
VAL1\n
```
* Space separated values
```text
2016-06-08 16:13:22 +08:00
VAL0 VAL1 ...\n
```
* Space separated keys and value, separated by new line
2016-06-08 16:13:22 +08:00
```text
KEY0 ... VAL0\n
KEY1 ... VAL1\n
2016-06-08 16:13:22 +08:00
```
## Tags
2016-06-08 16:13:22 +08:00
All measurements have the `path` tag.
2016-06-08 16:13:22 +08:00
## Configuration
2016-06-08 16:13:22 +08:00
```toml @sample.conf
# Read specific statistics per cgroup
[[inputs.cgroup]]
## 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 = [
# "/sys/fs/cgroup/memory",
# "/sys/fs/cgroup/memory/child1",
# "/sys/fs/cgroup/memory/child2/*",
2016-06-08 16:13:22 +08:00
# ]
## cgroup stat fields, as file names, globs are supported.
## these file names are appended to each path from above.
# files = ["memory.*usage*", "memory.limit_in_bytes"]
2020-07-25 00:42:17 +08:00
```
2016-06-08 16:13:22 +08:00
## Example
2020-07-25 00:42:17 +08:00
```toml
2016-06-08 16:13:22 +08:00
# [[inputs.cgroup]]
# paths = [
2020-07-25 00:42:17 +08:00
# "/sys/fs/cgroup/cpu", # root cgroup
# "/sys/fs/cgroup/cpu/*", # all container cgroups
# "/sys/fs/cgroup/cpu/*/*", # all children cgroups under each container cgroup
2016-06-08 16:13:22 +08:00
# ]
# files = ["cpuacct.usage", "cpu.cfs_period_us", "cpu.cfs_quota_us"]
2020-07-25 00:42:17 +08:00
# [[inputs.cgroup]]
# paths = [
# "/sys/fs/cgroup/unified/*", # root cgroup
# ]
# files = ["*"]
2016-06-08 16:13:22 +08:00
```