跳转至

System


System 采集器收集系统负载、正常运行时间、CPU 核心数量以及登录的用户数。

配置

成功安装 DataKit 并启动后,会默认开启 System 采集器,无需手动开启。

采集器配置

进入 DataKit 安装目录下的 conf.d/host 目录,复制 system.conf.sample 并命名为 system.conf。示例如下:

[[inputs.system]]
  ##(optional) collect interval, default is 10 seconds
  interval = '10s'

  [inputs.system.tags]
    # some_tag = "some_value"
    # more_tag = "some_other_value"

配置好后,重启 DataKit 即可。

可通过 ConfigMap 方式注入采集器配置配置 ENV_DATAKIT_INPUTS 开启采集器。

也支持以环境变量的方式修改配置参数(需要在 ENV_DEFAULT_ENABLED_INPUTS 中加为默认采集器):

  • ENV_INPUT_SYSTEM_INTERVAL

    采集器重复间隔时长

    字段类型: Duration

    采集器配置字段: interval

    默认值: 10s

  • ENV_INPUT_SYSTEM_TAGS

    自定义标签。如果配置文件有同名标签,将会覆盖它

    字段类型: Map

    采集器配置字段: tags

    示例: tag1=value1,tag2=value2


指标

以下所有数据采集,默认会追加名为 host 的全局 tag(tag 值为 DataKit 所在主机名),也可以在配置中通过 [inputs.system.tags] 指定其它标签:

 [inputs.system.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"
  # ...

system

Basic information about system operation.

  • 标签
Tag Description
host hostname
  • 指标列表
Metric Description
cpu_total_usage The percentage of used CPU.
Type: float
Unit: percent,percent
load1 CPU load average over the past 1 minute.
Type: float
Unit: N/A
load15 CPU load average over the past 15 minutes.
Type: float
Unit: N/A
load15_per_core CPU single core load average over the past 15 minutes.
Type: float
Unit: N/A
load1_per_core CPU single core load average over the past 1 minute.
Type: float
Unit: N/A
load5 CPU load average over the past 5 minutes.
Type: float
Unit: N/A
load5_per_core CPU single core load average over the last 5 minutes.
Type: float
Unit: N/A
memory_usage The percentage of used memory.
Type: float
Unit: percent,percent
n_cpus CPU logical core count.
Type: int
Unit: count
n_users User number.
Type: int
Unit: count
process_count Number of Processes running on the machine.
Type: int
Unit: count
uptime System uptime.
Type: int
Unit: time,s

conntrack

Connection track metrics (Linux only).

  • 标签
Tag Description
host hostname
  • 指标列表
Metric Description
entries Current number of connections.
Type: int
Unit: count
entries_limit The size of the connection tracking table.
Type: int
Unit: count
stat_drop The number of packets dropped due to connection tracking failure.
Type: int
Unit: count
stat_early_drop The number of partially tracked packet entries dropped due to connection tracking table full.
Type: int
Unit: count
stat_found The number of successful search entries.
Type: int
Unit: count
stat_ignore The number of reports that have been tracked.
Type: int
Unit: count
stat_insert The number of packets inserted.
Type: int
Unit: count
stat_insert_failed The number of packages that failed to insert.
Type: int
Unit: count
stat_invalid The number of packets that cannot be tracked.
Type: int
Unit: count
stat_search_restart The number of connection tracking table query restarts due to hash table size modification.
Type: int
Unit: count

filefd

System file handle metrics (Linux only).

  • 标签
Tag Description
host hostname
  • 指标列表
Metric Description
allocated The number of allocated file handles.
Type: int
Unit: count
maximum_mega The maximum number of file handles, unit M(10^6).
Type: float
Unit: count

FAQ

为什么没有 cpu_total_usage 指标?

CPU 部分采集功能不支持部分平台,如 macOS。

文档评价

文档内容是否对您有帮助? ×