telegraf/plugins/inputs/cgroup
an0nfunc 69d9a4322f
feat(inputs.cgroup): Added support for cpu.stat (#12798)
2023-03-07 09:42:53 +01:00
..
testdata feat(inputs.cgroup): Added support for cpu.stat (#12798) 2023-03-07 09:42:53 +01:00
README.md chore: Specify distro support (part 3) (#12792) 2023-03-06 12:18:43 +01:00
cgroup.go feat(inputs.cgroups): do not abort on first error, print message once (#12342) 2022-12-07 07:21:59 -07:00
cgroup_linux.go feat(inputs.cgroup): Added support for cpu.stat (#12798) 2023-03-07 09:42:53 +01:00
cgroup_notlinux.go chore: Remove deprecated build tags (#11867) 2022-09-22 13:25:31 -05:00
cgroup_test.go feat(inputs.cgroup): Added support for cpu.stat (#12798) 2023-03-07 09:42:53 +01:00
sample.conf chore: Specify distro support (part 3) (#12792) 2023-03-06 12:18:43 +01:00

README.md

CGroup Input Plugin

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.

Following file formats are supported:

  • Single value
VAL\n
  • New line separated values
VAL0\n
VAL1\n
  • Space separated values
VAL0 VAL1 ...\n
  • Space separated keys and value, separated by new line
KEY0 ... VAL0\n
KEY1 ... VAL1\n

Metrics

All measurements have the path tag.

Global configuration options

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 for more details.

Configuration

# Read specific statistics per cgroup
# This plugin ONLY supports Linux
[[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.
  # paths = [
  #   "/sys/fs/cgroup/memory",
  #   "/sys/fs/cgroup/memory/child1",
  #   "/sys/fs/cgroup/memory/child2/*",
  # ]
  ## 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"]

Example Configurations

# [[inputs.cgroup]]
  # paths = [
  #   "/sys/fs/cgroup/cpu",              # root cgroup
  #   "/sys/fs/cgroup/cpu/*",            # all container cgroups
  #   "/sys/fs/cgroup/cpu/*/*",          # all children cgroups under each container cgroup
  # ]
  # files = ["cpuacct.usage", "cpu.cfs_period_us", "cpu.cfs_quota_us"]

# [[inputs.cgroup]]
  # paths = [
  #   "/sys/fs/cgroup/unified/*",        # root cgroup
  # ]
  # files = ["*"]

Example Output